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

Re: [PATCH 7/7] rebase (without -p): correctly calculate patches to rebase

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Jul 20, 2012, 15:58 UTC
Message-ID
<CAOeW2eEMQrmSwS4ziTWetrWxkS-CTCPrJrzchCb1ZnqmaFhW7g@mail.gmail.com>
In-Reply-To
<50091469.5030307@viscovery.net>
On Fri, Jul 20, 2012 at 1:18 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 22 quoted lines
> Am 7/18/2012 9:27, schrieb Martin von Zweigbergk:
>> diff --git a/git-rebase--am.sh b/git-rebase--am.sh
>> index 37c1b23..fe3fdd1 100644
>> --- a/git-rebase--am.sh
>> +++ b/git-rebase--am.sh
>> @@ -16,11 +16,9 @@ skip)
>>       ;;
>>  esac
>>
>> -test -n "$rebase_root" && root_flag=--root
>>  test -n "$keep_empty" && git_am_opt="$git_am_opt --keep-empty"
>> -git format-patch -k --stdout --full-index --ignore-if-in-upstream \
>> -     --src-prefix=a/ --dst-prefix=b/ \
>> -     --no-renames $root_flag "$revisions" |
>> +generate_revisions |
>> +sed -e 's/\([0-9a-f]\{40\}\)/From \1 Mon Sep 17 00:00:00 2001/' |
>>  git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" &&
>>  move_to_original_branch
>
> Just curious (as all tests pass): What does this do? It looks like
> format-patch is not called anymore and git-am sees only SHA1s. Does it
> force git-am to cherry-pick the patches?

That probably deserves to be mentioned in the commit message. Or maybe in as a comment in the code. Either way, since 0fbb95d (am: don't call mailinfo if $rebasing, 2012-06-26), 'git am --rebasing' never looks at anything but the sha1, so most of the output from 'git format-patch' is currently ignored. It doesn't do cherry-pick, though, but runs 'git diff-tree' and other commands and then feeds the result to 'git apply', just like a regular 'git am' invocation would.

Martin
Previous: Johannes SixtNext: Johannes Sixt
Message 10 of 15 in “correctly calculate patches to rebase”
  1. 0/7 correctly calculate patches to rebaseMartin von Zweigbergk, Jul 18, 2012
  2. 1/7 git-rebase--am.sh: avoid special-casing --keep-emptyMartin von Zweigbergk, Jul 18, 2012
  3. 2/7 git-rebase--interactive.sh: extract function for adding "pick" lineMartin von Zweigbergk, Jul 18, 2012
  4. 3/7 git-rebase--interactive: group all $preserve_merges codeMartin von Zweigbergk, Jul 18, 2012
  5. 4/7 git-rebase--interactive.sh: look up subject in add_pick_lineMartin von Zweigbergk, Jul 18, 2012
  6. 5/7 rebase -p: use --cherry-mark for todo fileMartin von Zweigbergk, Jul 18, 2012
  7. 6/7 rebase -p: don't request --left-right only to ignore left sideMartin von Zweigbergk, Jul 18, 2012
  8. 7/7 rebase (without -p): correctly calculate patches to rebaseMartin von Zweigbergk, Jul 18, 2012
  9. Johannes SixtJul 20, 2012
  10. Martin von ZweigbergkJul 20, 2012
  11. Johannes SixtJul 20, 2012
  12. Martin von ZweigbergkJul 20, 2012
  13. Junio C HamanoJul 22, 2012
  14. Neil HormanJul 18, 2012
  15. Martin von ZweigbergkJul 18, 2012

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.