Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take advantage of more accurate comment to code mapping? #5

Closed
amichail opened this issue Jan 20, 2016 · 6 comments
Closed

Take advantage of more accurate comment to code mapping? #5

amichail opened this issue Jan 20, 2016 · 6 comments

Comments

@amichail
Copy link

Assuming that the comments are included in the committed code (and not just the commit comment), perhaps you could use the more accurate comment to code mapping for browsing and search purposes?

@jryio
Copy link
Owner

jryio commented Jan 21, 2016

Would you mind giving an example? Having a hard time understanding what this means in relation to feature/fix/improvement.

@amichail
Copy link
Author

For each line of code in the most recent version, you could associate with it all commit comment fragments that have applied to that line in particular.

With this information, you can get a lot of motivation for why the code is the way it is via browsing/searching based on this information.

@amichail
Copy link
Author

For example, you might want to search for "drag and drop" to find code fragments, possibly spread out, that collectively implement drag and drop.

@jryio
Copy link
Owner

jryio commented Jan 21, 2016

Ah I think I understand (correct me if I missed it). You'd like to see a relation between the commit comments and the lines of code which they were applied to.
Then be able to search for keywords in the commit comments themselves to see the lines of code which they referenced?

If that's the case, I'm afraid that feature might be a bit out of the scope of the current Bash scripts (which only searches & replaces lines).

One solution might be to perform a grep search on the output of git log using the -A or -B options. Those might give some context to the commit comments.

@amichail
Copy link
Author

So do you include the @commit comments in the code submitted? There's a lot of valuable information there with regards to the more accurate comment/lines of code mapping.

One problem with doing this though is that other developers may not be using your tool and so checking out code with @commit comments still included from the last commit would not be good.

@jryio
Copy link
Owner

jryio commented Jan 26, 2016

@commit comments are removed from the code via the post-commit hook.
As far as code mapping goes, I don't see solution which does not require a database or file of some kind.

If this is just for the programmer to see cool/neat relationships between their commit comments and actual code, it might be worth file for someone else to fork this project.

@jryio jryio closed this as completed Feb 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants