[PATCH] git-clone: lose the artificial "first" fetch refspec

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-08-11 · open the first message on its own page

[PATCH] git-clone: lose the artificial "first" fetch refspec

From: Junio C Hamano <hidden>
Date: 2016-08-11 20:13:49

Now we lost the "first refspec is the one that is merged by default"
rule, there is no reason for clone to list the remote primary branch
in the config file explicitly anymore.

We still need it for the traditional layout for other reasons,
though.

Signed-off-by: Junio C Hamano <redacted>

---
Junio C Hamano [off-list ref] writes:
quoted
We could also lose the "primary branch" mapping at the
beginning, but that has to wait until we implement the "forbid
'git pull' when we do not have branch.$current.merge for the
current branch" policy we earlier discussed.  That should also
be in v1.5.0
  And this does exactly that.
 Next step will be to remove the traditional layout altogether.
 With the recent flurry of UI updates, I think it is sane to do
 that before v1.5.0; opinions?

 git-clone.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index 422499a..68dc4f2 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -380,18 +380,18 @@ then
 			git-update-ref "refs/heads/$origin" "$head_sha1" ;;
 		esac &&
 
-		# Upstream URL and the primary branch tracking
+		# Upstream URL
 		git-repo-config remote."$origin".url "$repo" &&
-		git-repo-config remote."$origin".fetch \
-			"refs/heads/$head_points_at:$origin_track" &&
 
-		# Set up the mappings to track the remaining branches.
+		# Set up the mappings to track the remote branches.
 		case "$use_separate_remote" in
 		t)
 			git-repo-config remote."$origin".fetch \
 				"refs/heads/*:$remote_top/*" '^$'
 			;;
 		*)
+			git-repo-config remote."$origin".fetch \
+				"refs/heads/$head_points_at:$origin_track" &&
 			(cd "$GIT_DIR/$remote_top" && find . -type f -print) |
 			while read dotslref
 			do

Re: [PATCH] git-clone: lose the artificial "first" fetch refspec

From: Johannes Schindelin <hidden>
Date: 2016-08-11 19:40:27

Hi,

On Sat, 16 Dec 2006, Junio C Hamano wrote:
 With the recent flurry of UI updates, I think it is sane to do
 that before v1.5.0; opinions?
Answering to all of your recent patches in this direction: I like it.

Originally, I thought that this would require more from me: I often 
synchronize my git repository (including topic branches) between different 
machines back and forth, via usb stick, and two different central 
machines. I use the script I sent in this mail:

http://article.gmane.org/gmane.comp.version-control.git/6956/

However, I just realized that I will not need the script anymore, what 
with the recent addition of wildcards to remote.<branch>.fetch. Good job!

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help