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

Re: [PATCH 4/7] git-rebase--interactive.sh: look up subject in add_pick_line

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Jul 20, 2012, 15:47 UTC
Message-ID
<CAOeW2eHeySzEzj_8BByuz4jrc_CreLtZpTshcYsTxqBrtxyg0g@mail.gmail.com>
In-Reply-To
<5009135C.208@viscovery.net>
Thanks for reviewing.
On Fri, Jul 20, 2012 at 1:14 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 11 quoted lines
> Am 7/18/2012 9:27, schrieb Martin von Zweigbergk:
>> @@ -814,7 +814,8 @@ add_pick_line () {
>>       else
>>               comment_out=
>>       fi
>> -     printf '%s\n' "${comment_out}pick $1 $2" >>"$todo"
>> +     line=$(git rev-list -1 --pretty=oneline --abbrev-commit --abbrev=7 $1)
>> +     printf '%s\n' "${comment_out}pick $line" >>"$todo"
>
> I don't like this. On Windows, rebase -i is already slow, and these extra
> processes will make it even slower.
I don't like it either :-(.
> Anything that can be done about this? Perhaps the rev-list call can
> generate all of the full SHA1, the short SHA1, and the subject with a
> --pretty format?

After patch 7/7, cherry is used instead of rev-list. Ideally, I would have liked to teach "git rev-list --cherry-pick" to somehow use a <limit> just like cherry does, but I couldn't think of a generic way of doing that (in this case, we want to say something like "range a..b, but drop commits that are equivalent to any in b..c"). I actually don't remember if I gave up because I couldn't think of a sensible way of specifying ranges like that, or if I just ran out of time (not familiar with the revision-walking code). Now it seems to me that something like "git rev-list a..b --not-cherry-picks b..c" makes sense, but maybe it's just too specific and we should just support the limited (no pun intended) case we need to emulate "git cherry", i.e. something like "git rev-list --cherry-with-limit=a c...b". Feedback appreciated.

Martin
Previous: Johannes SixtNext: Junio C Hamano
Message 12 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.