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

Re: [PATCH 2/3] Rebase to parent branch after git-fetch in "stg pull".

From
Junio C Hamano <junkio@cox.net>
Date
Feb 4, 2007, 00:23 UTC
Message-ID
<7v8xfe22k5.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7v8xfe3kwo.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 11 quoted lines
> Yann Dirson <ydirson@altern.org> writes:
> ...
>> Since branch.*.merge accept local ref names, there is probably far
>> more to change that what I initially feared.
>
> If that is the case maybe we should fix branch.*.merge not to
> match the local tracking branch name.  Matching it with local
> tracking branch name when the remote name does not match was
> werely a fallback to help broken configurations confused people
> might create by hand, and has never been the part of sane
> practice at all.

That is, I suspect that reverting 80c79776 would make things a lot more consistent.

-- >8 -- [PATCH] Revert "Allow branch.*.merge to talk about remote tracking branches."

This reverts commit 80c797764a6b6a373f0f1f47d7f56b0d950418a9.

Back when I committed this, it seemed to be a good idea. People who always use remote tracking branches can optionally use the local name they happen to use to specify what to merge, which meant that I did not have to teach them why we use the name at the remote side every time they are confused.

But allowing it seems to break other people's scripts. The real solution is not to allow more ways to express the same thing, but to educate people to use the right syntax.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-parse-remote.sh |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 3e783b7..5208ee6 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -174,12 +174,8 @@ canon_refs_list_for_fetch () {
 		else
 			for merge_branch in $merge_branches
 			do
-			    if	test "$remote" = "$merge_branch" ||
-				test "$local" = "$merge_branch"
-			    then
-				    dot_prefix=
-				    break
-			    fi
+			    [ "$remote" = "$merge_branch" ] &&
+			    dot_prefix= && break
 			done
 		fi
 		case "$remote" in
-- 
1.5.0.rc3.24.g2391
Previous: Junio C HamanoNext: Yann Dirson
Message 11 of 21 in “Update to stgit parent tracking”
  1. 0/3 Update to stgit parent trackingYann Dirson, Feb 1, 2007
  2. 1/3 The user does not want to mess with the refspecs.Yann Dirson, Feb 1, 2007
  3. 2/3 Rebase to parent branch after git-fetch in "stg pull".Yann Dirson, Feb 1, 2007
  4. Catalin MarinasFeb 2, 2007
  5. Yann DirsonFeb 2, 2007
  6. Yann DirsonFeb 2, 2007
  7. Catalin MarinasFeb 2, 2007
  8. Catalin MarinasFeb 2, 2007
  9. Yann DirsonFeb 3, 2007
  10. Junio C HamanoFeb 3, 2007
  11. Junio C HamanoFeb 4, 2007
  12. Yann DirsonFeb 4, 2007
  13. Jeff KingFeb 4, 2007
  14. Junio C HamanoFeb 4, 2007
  15. Jeff KingFeb 4, 2007
  16. git-clone wrongly setting branch.*.merge ? (Was: [PATCH 2/3] Rebase to parent branch after git-fetch in "stg pull".)Yann Dirson, Feb 2, 2007
  17. Yann DirsonFeb 3, 2007
  18. Jakub NarebskiFeb 3, 2007
  19. Catalin MarinasFeb 3, 2007
  20. Yann DirsonFeb 3, 2007
  21. 3/3 Do not return 'origin' as parent remote when there is no such remote.Yann Dirson, Feb 1, 2007

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.