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

Re: [PATCH] git-format-patch: Don't number patches when there's only one

From
Andreas Ericsson <ae@op5.se>
Date
Oct 22, 2007, 11:13 UTC
Message-ID
<471C85C1.3020308@op5.se>
In-Reply-To
<Pine.LNX.4.64.0710221119300.25221@racer.site>
Johannes Schindelin wrote:
Show 23 quoted lines
> Hi,
> 
> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Sun, 21 Oct 2007, Andreas Ericsson wrote:
>>>
>>>> [PATCH 1/1] looks a bit silly, and automagically handling this in 
>>>> git-format-patch makes some scripting around it a lot more pleasant.
>>> I think you should not use "-n" if you do not want to have the 
>>> numbers.
>> This stems from creating scripts around it where I only want to see the 
>> numbers if there is more than a single patch. Currently I can't do that 
>> without running git-format-patch twice or re-implementing the revision 
>> parsing machinery to count revisions prior to passing arguments to 
>> format-patch.
> 
> Why not have something as simple as
> 
> 	numbered=
> 	test $(git rev-list $options | wc -l) -gt 1 && numbered=-n
> 

Because 23498~12 != 23498~12..HEAD to git rev-list, but it is to git-format-patch, meaning I'll have to duplicate the logic in every script that's supposed to use it or risk introducing a third way of specifying a list of revisions.

Show 7 quoted lines
> 	[...]
> 
> 	git format-patch $numbered $options
> 
> At the moment, the semantics of "--numbered" is really clear and precise.  
> And I really like that.  It makes for less surprises.
> 
Semantics could be equally clear for --numbered-if-multiple.
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Johannes SchindelinNext: Mike Hommey
Message 5 of 14 in “git-format-patch: Don't number patches when there's only one”
  1. git-format-patch: Don't number patches when there's only oneAndreas Ericsson, Oct 21, 2007
  2. Johannes SchindelinOct 22, 2007
  3. Andreas EricssonOct 22, 2007
  4. Johannes SchindelinOct 22, 2007
  5. Andreas EricssonOct 22, 2007
  6. git-format-patch: Number patches when there are more than oneMike Hommey, Nov 3, 2007
  7. Andreas EricssonNov 3, 2007
  8. Mike HommeyNov 3, 2007
  9. Andreas EricssonNov 3, 2007
  10. Samuel TardieuNov 3, 2007
  11. Johannes SchindelinNov 3, 2007
  12. Andreas EricssonNov 3, 2007
  13. Johannes SchindelinNov 4, 2007
  14. Andreas EricssonNov 4, 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.