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

Re: [PATCH] git-pickaxe: blame rewritten.

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Oct 13, 2006, 01:04 UTC
Message-ID
<20061013010402.99837.qmail@web31814.mail.mud.yahoo.com>
In-Reply-To
<7vzmc1jcz0.fsf@assigned-by-dhcp.cox.net>
--- Junio C Hamano <junkio@cox.net> wrote:
Show 8 quoted lines
> > ---cut---
> > The porcelain format is as follows:
> >
> > <SHA-1> <orig line> <line> [<num lines>
> 
> This is misleading.  <num lines> is always shown for the group
> head, even if there was another group earlier from the same
> commit (otherwise the Porcelain has to buffer the chunk, which
Completely understood and always agreed upon.
> you did not like).  Second and subsequent lines in the same
> group do not have <num lines>.
Completely understood and always agreed upon.
Show 20 quoted lines
> 
> > author <name>
> > author-mail <email format>
> >...
> > committer-tz <TZ>
> > filename <string>
> > summary <string>]
> > <TAB><line data>
> >
> > Where
> >   <SHA-1> is the SHA-1 of the commit which introduces this line.
> >   <orig line> it the line number where this line is introduced.
> >   <line> is the line number of the final file (at SHA-1 commit)
> >
> > Then, if <SHA-1> is different from the previous line's SHA-1 (if no
> > previous then always different), a header follows.  It starts by the
> > number of lines that this <SHA-1> commit introduces,...
> 
> So this description is wrong; <num lines> is not part of the
> "extra".
So, it is possible to print

<SHA-1> <orig lineno> <this lineno> <num lines> TAB<data line>

?
> I deliberately left it vague so that we can add things later to
> the header.  Porcelains should ignore the fields that they do
> not understand, and should not expect these fields listed above
> come in the order the above list shows.

If the format changes, then porcelains should change their parsing algorithms.

> Also I deliberately left it vague so that Porcelains can get the
> header for the same SHA-1 more than once.  This is needed when

For different blocks separated by at least one different commit, yes. But the opposite should not be true.

That is, you start a group, only when the previous commit differs from this commit.

It would be prudent to print a <num lines> iff a group is started.
Show 8 quoted lines
> we add "ciff" to pick more than one paths from the same commit.
> In such a case, most likely we are better off not to repeat
> header fields from author...committer-tz and summary but we
> would need filename.  The expectation to the Porcelains is:
> 
>    Read one line, which begins with commit object name and two
>    or three numbers; if it has three numbers, it is the
>    beginning of a group.
And if it doesn't have three numbers?
    Luben
Previous: Junio C HamanoNext: Junio C Hamano
Message 14 of 18 in “git-pickaxe: blame rewritten.”
  1. git-pickaxe: blame rewritten.Junio C Hamano, Oct 12, 2006
  2. Linus TorvaldsOct 12, 2006
  3. Junio C HamanoOct 12, 2006
  4. Luben TuikovOct 12, 2006
  5. Junio C HamanoOct 13, 2006
  6. Junio C HamanoOct 13, 2006
  7. Luben TuikovOct 12, 2006
  8. Junio C HamanoOct 12, 2006
  9. Luben TuikovOct 13, 2006
  10. Junio C HamanoOct 13, 2006
  11. Luben TuikovOct 13, 2006
  12. Junio C HamanoOct 13, 2006
  13. Junio C HamanoOct 13, 2006
  14. Luben TuikovOct 13, 2006
  15. Junio C HamanoOct 13, 2006
  16. Jakub NarebskiOct 12, 2006
  17. Petr BaudisOct 12, 2006
  18. Junio C HamanoOct 12, 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.