aspiers / git-deps

git commit dependency analysis tool
GNU General Public License v2.0
298 stars 47 forks source link

idea: blame-deps (aka 3D-blame) #43

Open tfnico opened 9 years ago

tfnico commented 9 years ago

The idea is to do something like

git deps some-file.txt

This will open the git-deps browser with the contents of the file loaded into a pane in a typical blame view:

e5392d87  1) This is some file.
e5392d87  2) =====================================
e5392d87  3)
69d951f2  4) Look at all the nice contents.
e5392d87  5)

The magical thing is that each of the revisions are clickable - doing so will open the git-deps graph for the clicked commit.

aspiers commented 9 years ago

Yeah, that would be nice! This is one example of why I think #23 is the way to go - I don't want git-deps to have to reinvent standard functionality like blame which is already in existing git web UIs. If a single web UI has the git-deps graph embedded within it, then it would be extremely easy to build links between the graph and several other parts of the UI.

tfnico commented 9 years ago

Thinking out loud here.. Personally I use command-line, Vim or IntelliJ IDEA for blaming. I can imagine making a Vimscript binding that would fire up git-deps when hitting enter on a commitish. IDEA would need a plugin, and I'm not sure how easy it is to embed python inside there.

@aspiers Know any web UIs that have blame included already? I couldn't see it in git-arr. Were you thinking of providing it for more permanent server processes like gitweb?

aspiers commented 9 years ago

BTW listening back to http://youtu.be/YUSsuyYgmM0?t=44m7s it sounds like maybe you've never tried git gui blame which has right mouse click functionality which significantly smoothes out the process of playing the "blame game"?

But anyway, yes it should be easy to launch git-deps from any editor. I would need to tweak the webserver so that a given URL (e.g. http://localhost:5000/?commitish=1a4825e) can immediately jump to rendering dependencies of that commit, but that shouldn't be hard.

goblet already has blame support, e.g. http://git.kaarsemaker.net/atftp/blame/master/README

tfnico commented 9 years ago

@aspiers Thanks for the git gui tip. The blame parent commit is exactly what I do/need.

mhagger commented 9 years ago

@tfnico: In gitk you can also right-click on any line of text and select "Show origin of this line". This jumps to the commit that last modified the line and highlights the actual line. I find it super useful.

tfnico commented 9 years ago

@mhagger Nice! Thanks for the tip.

domcleal commented 9 years ago

tig also has this feature. Run tig blame $file and use , on a line to view the blame for the parent of the commit that last changed the line.

tfnico commented 9 years ago

@domcleal Wow, consider my mind blown! +10k for that tip!

aspiers commented 9 years ago

It should go without saying that emacs can also do this ;-) magit FTW!