git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Following renames

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Mar 26, 2006, 19:22 UTC
Message-ID
<e5bfff550603261122m5e680c62ye1290f3e601e947e@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.64.0603260947100.15714@g5.osdl.org>
On 3/26/06, Linus Torvalds <torvalds@osdl.org> wrote:
Show 26 quoted lines
>
>
> So wouldn't it be _much_ nicer to have a "graphical git-whatchanged",
> where you just delve deeper (and you don't even look at the whole file
> like git-whatchanged does, but you ask for a very particular region).
>
> Ie, what I imagine would be something gitk/qgit like, where you see the
> file content, select a line or two (or a whole function), and it goes back
> in history and shows you the last diff that changed that
> line/two/function. We can do that EFFICIENTLY. Much more efficiently than
> git-annotate, in fact. And then when you see the diff, you might say "I'm
> not interested in this one, that was just a re-indent" and then continue
> back.
>
> THAT is the kind of graphical tool I'd want. And dammit, it should even be
> _easy_. I'm just a total clutz myself when it comes to doing things like
> QT or nice tcl/tk text-panes, and this really does have to be visual,
> since the whole point is that "select text" and interactive part.
>
> So if somebody wants to be a hero, and feels comfortable with those kinds
> of things, this really should be a fairly straightforward thing to do (it
> would be useful even without rename detection or data movement detection,
> but it's also something where you really _could_ do efficient data
> movement detection by just looking at the "whole diff" when something
> changed in that small area).
>
I am a thousand miles away from being an hero (and glad of it), but....

I really need a bit of feedback or comment about this because IMHO qgit annotate is *almost* very similar to what you would ask, so I need to understand well the difference:

FIRST WAY

After annotating a file history (double click on a file name in bottom-right window or directly from tree view), you see the whole file annotated. If you have the diff window open you see also the corresponding patch (scrolled to selected file name).

Now, double clicking on the chosen code line in file content makes currently two things:

  - Diff window is updated to show corresponding revision patch, i.e.
the last patch that modified that line of code.
- File content, as well as file annotation, changes to show the
content of the file just after the patch was applied, from there it is
normally possible to go back in the history of that code region in the
same way, i.e. double clicking on interesting lines.

Biggest limitation of 'annotation browsing' is that 'code removing only' patches are not annotated and you need to check them directly in diff window.

SECOND WAY

Without opening the file viewer it is possible to select a file (or more then one or one directory) from tree view and press magic wand button. This causes main view to be updated with git-rev-list -- <selected paths> content, i.e. a filtered view.

With diff viewer window open you can browse across file patch history related to chosen file.

Biggest limitation is that all the revisions who touch the file are shown, not only the ones limited to a selected region.

IF I HAVE UNDERSTOOD...
If I have understood what you would like to see it something like the following:
- From diff/file viewer window select a code region.
- Press Magic wand button and feed git-rev-list with <selected path>
_and_  <selected content>
- Show git-rev-list output on main window as usual, but now selected
revisions are filtered out not only for path but also for region of
code touched.
Am I guessing correctly?
Marco
Previous: Linus TorvaldsNext: Linus Torvalds
Message 13 of 41 in “Following renames”
  1. Petr BaudisMar 26, 2006
  2. Junio C HamanoMar 26, 2006
  3. Jakub NarebskiMar 26, 2006
  4. Paul JakmaMar 27, 2006
  5. Petr BaudisMar 26, 2006
  6. Petr BaudisMar 26, 2006
  7. Timo HirvonenMar 26, 2006
  8. Linus TorvaldsMar 26, 2006
  9. Jakub NarebskiMar 26, 2006
  10. Linus TorvaldsMar 26, 2006
  11. Jakub NarebskiMar 26, 2006
  12. Linus TorvaldsMar 26, 2006
  13. Marco CostalbaMar 26, 2006
  14. Linus TorvaldsMar 26, 2006
  15. Marco CostalbaMar 27, 2006
  16. Junio C HamanoMar 27, 2006
  17. Linus TorvaldsMar 27, 2006
  18. Marco CostalbaMar 27, 2006
  19. Johannes SchindelinMar 27, 2006
  20. Linus TorvaldsMar 27, 2006
  21. Marco CostalbaMar 27, 2006
  22. Andreas EricssonMar 27, 2006
  23. Jakub NarebskiMar 27, 2006
  24. David LangMar 27, 2006
  25. Jakub NarebskiMar 27, 2006
  26. Linus TorvaldsMar 26, 2006
  27. Ryan AndersonMar 26, 2006
  28. Petr BaudisMar 26, 2006
  29. Fredrik KuivinenMar 26, 2006
  30. Linus TorvaldsMar 26, 2006
  31. Petr BaudisMar 26, 2006
  32. Petr BaudisMar 26, 2006
  33. Linus TorvaldsMar 26, 2006
  34. Petr BaudisMar 26, 2006
  35. Junio C HamanoMar 26, 2006
  36. Linus TorvaldsMar 26, 2006
  37. Junio C HamanoMar 27, 2006
  38. Linus TorvaldsMar 26, 2006
  39. Petr BaudisMar 26, 2006
  40. Petr BaudisMar 27, 2006
  41. Petr BaudisMar 26, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.