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

Re: [PATCH] Let format-patch and rebase ignore trivial merges.

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Dec 17, 2009, 11:40 UTC
Message-ID
<4B2A1895.2000803@viscovery.net>
In-Reply-To
<20091217093547.GA25451@pcpool00.mathematik.uni-freiburg.de>
Bernhard R. Link schrieb:
Show 10 quoted lines
> * Johannes Sixt <j.sixt@viscovery.net> [091216 17:53]:
>> Bernhard R. Link schrieb:
>>> --prune-tree makes rev-list without paths equivalent to
>>> "git rev-list $options -- ." (or .. or ../.. and so on,
>>> if you are in some subdirectory).
>>> This is the new default for format-patch and rebase
>> Why do you need a new option when you can just add "-- ." to the rev-list
>> invocation?
> 
> I want the default for format-patch changed.

I do not see why format-patch would have to be changed. The case that you outline (a merge -s ours happened and you want to follow only one parent) is rare enough and even more rarly will somebody want to apply format-patch to such a history.

But I guess that you are actually not interested in format-patch per se, but rather in rebase (which uses format-patch).

Show 5 quoted lines
> For this I think it is easiest to add a new rev_info flag, as otherwise
> format-patch would need to duplicate parsing the rev_list options
> and either duplicate applying revs->prune_data or changing the argv for
> setup_revisions with some special casing of bare repository and non-bare
> repository cases.

I haven't looked at the code, but wouldn't it be matter of "if we do not have any pathspec, add '.'" *after* all options are parsed?

> And when there is that option, I think it is more robust to use that
> in merge -m and merge -i, as "-- ." only does the right thing by chance
> because both only work with a non-bare repository and have
> cd_to_toplevel.

git rev-list -- . works in a bare repository, too. If you hard-code "-- ." in the rev-list invocations in git-rebase[--interactive], then it cannot be said that this works "by chance" due to cd_to_toplevel.

-- Hannes
Previous: Bernhard R. LinkNext: Bernhard R. Link
Message 4 of 11 in “Let format-patch and rebase ignore trivial merges.”
  1. Let format-patch and rebase ignore trivial merges.Bernhard R. Link, Dec 16, 2009
  2. Johannes SixtDec 16, 2009
  3. Bernhard R. LinkDec 17, 2009
  4. Johannes SixtDec 17, 2009
  5. Bernhard R. LinkDec 17, 2009
  6. Junio C HamanoDec 17, 2009
  7. Bernhard R. LinkDec 18, 2009
  8. Johannes SixtDec 18, 2009
  9. Bernhard R. LinkDec 18, 2009
  10. Let format-patch and rebase ignore trivial merges.Bernhard R. Link, Dec 18, 2009
  11. Junio C HamanoDec 18, 2009

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.