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

Re: [PATCH] Use reflog in 'pull --rebase . foo'

From
SBSanti Béjar <santi@agolina.net>
Date
Nov 13, 2010, 23:10 UTC
Message-ID
<AANLkTi=QQZUjYtvRRiunrsCXMOX9+85K_nZXwsrT30bM@mail.gmail.com>
In-Reply-To
<AANLkTineaFVawXbJKHKv39bwPco7JHcmpUwXtZhscaFs@mail.gmail.com>

On Sat, Nov 13, 2010 at 6:52 PM, Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> wrote:

Show 27 quoted lines
> On Sat, Nov 13, 2010 at 12:20 PM, Santi Béjar <santi@agolina.net> wrote:
>> On Sat, Nov 13, 2010 at 1:09 PM, Martin von Zweigbergk
>> <martin.von.zweigbergk@gmail.com> wrote:
>>> diff --git a/git-parse-remote.sh b/git-parse-remote.sh
>>> index 5f47b18..2e1661d 100644
>>> --- a/git-parse-remote.sh
>>> +++ b/git-parse-remote.sh
>>> @@ -63,11 +63,8 @@ get_default_remote () {
>>>  get_remote_merge_branch () {
>>>        case "$#" in
>>>        0|1)
>>> -           origin="$1"
>>> -           default=$(get_default_remote)
>>> -           test -z "$origin" && origin=$default
>>>            curr_branch=$(git symbolic-ref -q HEAD)
>>> -           [ "$origin" = "$default" ] &&
>>> +           test -z "$1" || test "$1" = $(get_default_remote) &&
>>>            echo $(git for-each-ref --format='%(upstream)' $curr_branch)
>>>            ;;
>>>        *)
>>
>> They are not equivalent, the last line (echo $(git for-each-ref...))
>> is always executed, not only when ask for the default remote. When
>> $origin != $default the last line does not return the correct answer.
>> It should return nothing, it is not well defined. Or maybe it should
>> return the branch pointed by $origin/HEAD (I cannot test right now
>> what 'git pull $remote-not-the-default' merges).

After thinking (and testing) this again, I see now that I was wrong, the behavior is identical. But I find it more difficult to follow, but maybe it is because I wrote the original.

Show 8 quoted lines
>>
>> And it has nothing to do with letting 'pull --rebase . for" work.
>
> You are right, of course. I think I was modifying the code to try to
> understand how it behaved and it should not have been part of the patch.
> Sorry about that.
>
> Junio, will you just exclude that hunk?
Better send it again, and add my
Ack-by: Santi Béjar <santi@agolina.net>
Santi
Previous: Martin von Zweigbergk
Message 6 of 6 in “Use reflog in 'pull --rebase . foo'”
  1. Use reflog in 'pull --rebase . foo'Martin von Zweigbergk, Nov 12, 2010
  2. Andreas SchwabNov 13, 2010
  3. Martin von ZweigbergkNov 13, 2010
  4. Santi BéjarNov 13, 2010
  5. Martin von ZweigbergkNov 13, 2010
  6. Santi BéjarNov 13, 2010

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.