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

Re: [PATCHv3 1/4] parse-remote: function to get the tracking branch to be merge

From
SBSanti Béjar <santi@agolina.net>
Date
Jun 9, 2009, 12:16 UTC
Message-ID
<adf1fd3d0906090516l6b1d5ec1rdc78ffffa116b765@mail.gmail.com>
In-Reply-To
<adf1fd3d0906090150k575c538ds28cd8c1a96909e9e@mail.gmail.com>
2009/6/9 Santi Béjar <santi@agolina.net>:
Show 21 quoted lines
> 2009/6/9 Junio C Hamano <gitster@pobox.com>:
>> Santi Béjar <santi@agolina.net> writes:
>>
>>>> git pull --rebase tags v1.6.0
>>>
>>> In fact: git pull --rebase remote tags v1.6.0
>>>
>>> But this still works because oldremoteref defaults to defaults_merge.
>>> So the only behavior change is when a remote branch is
>>> rebased/retagged, and you have worst problems then. I think noone used
>>> the rebased functionality in this way, so I don't think it is worth to
>>> support it. But if someone think it is important I'll do it.
>>
>> I personally do not think supporting such a form of input is absolutely
>> necessary.  Even though technically it might be a regression, if it is so
>> rare a form, we can simply say "this strange form used to work, but now it
>> does not; you can use this form instead to do the same thing", and move
>> on.
>
> OK.
>

At the end it was a little patch to get this corner case working. Here it is the patch to squash (I'll send later a proper patch mail, with a test).

And this additional sentence in the commit log:

No behavior changes. The new function behaves like the old code used in "git pull --rebase".

diff --git i/git-parse-remote.sh w/git-parse-remote.sh
index 8b3ba72..4ac277f 100755
--- i/git-parse-remote.sh
+++ w/git-parse-remote.sh
@@ -238,8 +238,12 @@ get_remote_merge_branch () {
 	    shift
 	    # FIXME: It should return the tracking branch
 	    #        Currently only works with the default mapping
-	    for ref
-	    do
+	    case "$1" in
+	    tag)
+		[ -n "$2" ] && echo "refs/tags/${ref}"
+		;;
+	    *)
+		ref=$1
 		case "$ref" in
 		+*)
 			ref=$(expr "z$ref" : 'z+\(.*\)')
@@ -251,12 +255,11 @@ get_remote_merge_branch () {
 		'' | HEAD ) remote=HEAD ;;
 		heads/*) remote=${remote#heads/} ;;
 		refs/heads/*) remote=${remote#refs/heads/} ;;
-		refs/* | tags/* | remotes/* ) break
+		refs/* | tags/* | remotes/* ) remote=
 		esac

-		echo "refs/remotes/$repo/$remote"
-		break
-	    done
+		[ -n "$remote" ] && echo "refs/remotes/$repo/$remote"
+	    esac
 	    ;;
 	esac
 }

(Sorry, if it gets corrupted)

Santi
Previous: Santi BéjarNext: Santi Béjar
Message 7 of 8 in “[PATCHv3 1/4] parse-remote: function to get the tracking branch to be merge”
  1. Santi BéjarJun 8, 2009
  2. Junio C HamanoJun 8, 2009
  3. Santi BéjarJun 9, 2009
  4. Santi BéjarJun 9, 2009
  5. Junio C HamanoJun 9, 2009
  6. Santi BéjarJun 9, 2009
  7. Santi BéjarJun 9, 2009
  8. Santi BéjarJun 11, 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.