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

Re: [PATCHv2 2/2] pull: support rebased upstream + fetch + pull --rebase

From
SBSanti Béjar <santi@agolina.net>
Date
Jul 16, 2009, 23:18 UTC
Message-ID
<adf1fd3d0907161618o61ee4b58of25659f8c36420f7@mail.gmail.com>
In-Reply-To
<7vhbxc8inp.fsf@alter.siamese.dyndns.org>
2009/7/16 Junio C Hamano <gitster@pobox.com>:
Show 23 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> How about
>>
>>       oldremoteref="$(git rev-list --boundary HEAD --not \
>>                       $(git rev-list -g $remoteref | sed 's/$/^@/') |
>>               sed -e '/^[^-]/d' -e q)"
>>
>> Explanation: the "git rev-list -g $remoteref" lists the previous commits
>> the remote ref pointed to, and the ^@ appended to them means all their
>> parents.  Now, the outer rev-list says to take everything in HEAD but
>> _not_ in those parents, showing the boundary commits.  The "sed" call
>> lists the first such boundary commit (which must, by construction, be one
>> of the commits shown by the first rev-list).
>
> Hmm, I am not sure about that "(which must..." part.  When you have
>
>          Y---X
>         /
>        B---o---o---o---H
>
> wouldn't "rev-list --boundary H --not X^@" give B, not X nor Y?
>

$git rev-list --boundary H --not X and $git rev-list --boundary H --not X^@

return the same output in this case: o o o -B

In this case the correct command is without ^@, because you want the commits in the reflog as boundary commits.

In the simpler and usual case, without a rebased upstream:
    z---B---o---o---o---H
B=upstream@{0}

$git rev-list --boundary H --not B^@ o o o B -z

and:

$git rev-list --boundary H --not B o o o -B

Also in the rebased upstream case:
      Y---X
     /
    z---B---o---o---o---H

X=upstream@{0} B=upstream@{1}

$git rev-list --boundary H --not X^@ B^@ o o o B -z

and:

$git rev-list --boundary H --not X B o o o -B

HTH, Santi

Previous: Junio C HamanoNext: Santi Béjar
Message 12 of 19 in “t5520-pull: Test for rebased upstream + fetch + pull --rebase”
  1. 1/2 t5520-pull: Test for rebased upstream + fetch + pull --rebaseSanti Béjar, Jul 16, 2009
  2. 2/2 pull: support rebased upstream + fetch + pull --rebaseSanti Béjar, Jul 16, 2009
  3. Junio C HamanoJul 16, 2009
  4. Santi BéjarJul 16, 2009
  5. 2/2 pull: support rebased upstream + fetch + pull --rebaseSanti Béjar, Jul 16, 2009
  6. 2/2 pull: support rebased upstream + fetch + pull --rebaseSanti Béjar, Jul 16, 2009
  7. Santi BéjarJul 16, 2009
  8. Johannes SchindelinJul 16, 2009
  9. Santi BéjarJul 16, 2009
  10. Johannes SchindelinJul 17, 2009
  11. Junio C HamanoJul 16, 2009
  12. Santi BéjarJul 16, 2009
  13. Santi BéjarJul 17, 2009
  14. Junio C HamanoJul 17, 2009
  15. Santi BéjarJul 17, 2009
  16. 2/2 pull: support rebased upstream + fetch + pull --rebaseSanti Béjar, Jul 18, 2009
  17. Junio C HamanoJul 18, 2009
  18. Santi BéjarJul 19, 2009
  19. 2/2 pull: support rebased upstream + fetch + pull --rebaseSanti Béjar, Jul 19, 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.