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

Re: git-format-patch little gripe

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 3, 2006, 20:53 UTC
Message-ID
<eiga89$ho$1@sea.gmane.org>
In-Reply-To
<20061103195253.9244.qmail@web31814.mail.mud.yahoo.com>
Luben Tuikov wrote:
> --- Junio C Hamano <junkio@cox.net> wrote:
Show 15 quoted lines
>> One thing we talked about but nobody stepped up to code [*1*] is
>> to give "git-format-patch --stdin" that reads list of commits,
>> and runs "git-diff-tree --pretty --stat --summary -p $commit".
>> With that, we could do something like:
>> 
>>      git rev-list linus..orinoco | git format-patch --stdin
> 
> That'd be swell to have.
> 
>> Your "git-format-patch --single $commit" is a shorthand for a
>> degenerated special case of that pattern.
> 
> Yes, except that I'd have to paste the sha-1 into the terminal
> rather than on the command line.  This again proves that the current
> git-format-patch <sha-1> to mean "<sha-1>..HEAD" is horribly broken.

First, you could have behavior you wanted by using additional option --single, i.e. git-format-patch --single <sha-1> would mean git-format-patch <sha-1>^..<sha-1>

But I agree that it is somewhat counter-intuitive that for all
other commands which use revision list <sha-1> means lineage
of <sha-1> while for git-format-patch it means <sha-1>..HEAD
... and we have <sha-1>.. shortcut (two characters more) to mean
the same.
 
Another command with non-obvious UI is git-format-branch, which
is not CLI equivalent of gitk/qgit (doesn't accept revision range
for example).
Show 9 quoted lines
>> You cannot do patch-id based filtering with this form, but I see
>> that "single" is often wanted on the list and #git, and people
>> who want it do not care about patch-id based filtering at all.
> 
> The reason it is wanted is because it is _intuitive_.  This is
> what engineers (of different backgrounds) tend to intuitively think
> and assume given git's structure and the nature and meaning of
> what an <sha-1> is in git, only to be surprised later when that
> assumption is completely broken by git-format-patch.
Intuiveness is in the eye of beholder :-)
Show 6 quoted lines
>> And I do not think it is that "they do not realize how much they
>> would be missing without patch-id filtering", in this case.  So
>> the above command line would probably be Ok.
> 
> I do not think they'd be missing _anything_.  After all,
> "git-format-patch <sha-1>..HEAD" is also intuitive.
And we have <sha-1>.. shortcut. 
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Luben TuikovNext: Junio C Hamano
Message 7 of 13 in “Re: git-format-patch little gripe”
  1. Martin LanghoffNov 3, 2006
  2. Luben TuikovNov 3, 2006
  3. Junio C HamanoNov 3, 2006
  4. Carl WorthNov 3, 2006
  5. Jakub NarebskiNov 3, 2006
  6. Luben TuikovNov 3, 2006
  7. Jakub NarebskiNov 3, 2006
  8. Junio C HamanoNov 3, 2006
  9. Carl WorthNov 3, 2006
  10. Jeff KingNov 3, 2006
  11. Jakub NarebskiNov 3, 2006
  12. Linus TorvaldsNov 4, 2006
  13. Jakub NarebskiNov 4, 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.