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

Re: qgit: Annotate hundreds of files at terrific speed ;-)

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Jun 25, 2007, 11:20 UTC
Message-ID
<e5bfff550706250420s603e36eds9a2bcbb339aac80e@mail.gmail.com>
In-Reply-To
<200706250638.l5P6crkS026564@mi1.bluebottle.com>
On 6/25/07, Nanako Shiraishi <nanako3@bluebottle.com> wrote:
Show 10 quoted lines
>
> >> Marco Costalba <mcostalba@gmail.com> wrote:
> >
> > - filtering, ie selecting with the mouse some lines and getting a
> > subset of the file history that modified at least one of that lines is
> > not possible.
>
> I often use "git blame -L'/regexp/,/regexp/'" (you can use line
> numbers there, too).  Is this different from what you talk above?
>
Yes it.
Suppose you have selected file lines from 20 to 23 in revision A.
Revision history it's the following, in cronological order:
A (oldest) -> B - > C (newest)

Say that in revision B the patch removed 5 lines from 5 to 10 and added 2 new lines instead.

Now when you jump from A to revision C you may want to see selected the lines (-5 + 2 = -3) from 17 to 20 and no more the lines from 20 to 23 that will point to a different content.

In a general case jumping from a revision A to a revision N you have to:
- get the list of intermediate revision
- for each revision calculate deleted/ added content that is before
the selected lines range.
- for each revision calculate deleted/ added content that CROSSES the
selected range, so that if in our example revision B adds also 2 new
lines in position 21 the selection in C will not be 17 to 20 but 17 to
22!  The same logic in case of deleted lines in selected range.

So to keep a "consistent" mouse selection when jumping to different file revisions you really need to know all the annotate history in between.

Marco
Previous: Nanako Shiraishi
Message 5 of 5 in “qgit: Annotate hundreds of files at terrific speed ;-)”
  1. Marco CostalbaJun 23, 2007
  2. Shawn O. PearceJun 24, 2007
  3. Marco CostalbaJun 25, 2007
  4. Nanako ShiraishiJun 25, 2007
  5. Marco CostalbaJun 25, 2007

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.