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

Re: What's in git.git (stable)

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Dec 26, 2006, 20:25 UTC
Message-ID
<418215.90592.qm@web31809.mail.mud.yahoo.com>
In-Reply-To
<7vac1fy5ae.fsf@assigned-by-dhcp.cox.net>
--- Junio C Hamano <junkio@cox.net> wrote:
> I am not quite sure about that.  An old timer would work in a
> newly cloned repository after all, and what this "newbie
> protection" is breaking is not existing repositories but
> expectation from existing users.

Hmm, "newbie protection" doesn't sound good. It sounds like "screw the old-timers and let's change well-established workflow".

The expectation is that one always pulls into origin, merges into master, and maybe checks out master to see the remote master. From then on, they decide what, where and how to merge (from) master into any local branches, and then eventually export local branches to the public.

The "^branch.\.*" options seem to be counter-intuitive to
1) git's behavor and 2) see above.

Generally "pulling" a remote master in a local branch, without the local "origin+master" being fast-forwarded/merged should be considered non-git-conformant behavior. Assuming that the local branch is a branch of master/origin, which is almost ever the case.

Show 28 quoted lines
> In any case, here is a patch for discussion.
> 
> diff --git a/git-parse-remote.sh b/git-parse-remote.sh
> index f163821..b4d071b 100755
> --- a/git-parse-remote.sh
> +++ b/git-parse-remote.sh
> @@ -145,10 +145,22 @@ canon_refs_list_for_fetch () {
>  			merge_branches=$(git-repo-config \
>  			    --get-all "branch.${curr_branch}.merge")
>  		fi
> -		# If we are fetching only one branch, then first branch
> -		# is the only thing that makes sense to merge anyway,
> -		# so there is no point refusing that traditional rule.
> -		if test $# != 1 && test "z$merge_branches" = z
> +		if test "z$merge_branches" = z &&
> +			# If we are fetching only one branch, then
> +			# first branch is the only thing that makes
> +			# sense to merge anyway, so there is no point
> +			# refusing that traditional rule.
> +			test $# != 1 &&
> +
> +			# Also, old timers have been happily working
> +			# with the first branch rule without having
> +			# any branch.*.merge configuration, so if
> +			# there is none, do not bother with this
> +			# "newbie protection".  A newly cloned
> +			# repository would have branch.master.merge
> +			# set for it.

It should probably have branch.*.remote _and_ branch.*.merge set for completeness. Or we should remove the branch.* options from git-config and leave this up to porcelains.

> +			git repo-config --get-regexp \
> +				'^branch\..*\.merge$' >/dev/null
How does this "set" it?
    Luben
>  		then
>  			merge_branches=..this..would..never..match..
>  		fi
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 20 in “What's in git.git (stable)”
  1. Junio C HamanoDec 22, 2006
  2. Randal L. SchwartzDec 22, 2006
  3. Randal L. SchwartzDec 22, 2006
  4. Johannes SchindelinDec 22, 2006
  5. Randal L. SchwartzDec 22, 2006
  6. Randal L. SchwartzDec 22, 2006
  7. Johannes SchindelinDec 22, 2006
  8. Junio C HamanoDec 22, 2006
  9. Johannes SchindelinDec 22, 2006
  10. Junio C HamanoDec 22, 2006
  11. Luben TuikovDec 26, 2006
  12. Junio C HamanoDec 26, 2006
  13. Luben TuikovDec 27, 2006
  14. Junio C HamanoDec 27, 2006
  15. Junio C HamanoDec 22, 2006
  16. Jakub NarebskiDec 22, 2006
  17. Junio C HamanoDec 22, 2006
  18. Jakub NarebskiDec 22, 2006
  19. Junio C HamanoDec 22, 2006
  20. Quy TonthatDec 22, 2006

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.