{"thread":{"id":"8620","subject":"[PATCH] Cloning from a repo without \"current branch\"","startedAt":"2007-06-16T22:26:08Z","lastAt":"2007-06-22T03:34:57Z","messageCount":8,"participants":["Nanako Shiraishi","Junio C Hamano","Shawn O. Pearce","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"45195","messageId":"200706162226.l5GMQBss004492@mi0.bluebottle.com","threadId":"8620","inReplyTo":null,"subject":"[PATCH] Cloning from a repo without \"current branch\"","fromName":"Nanako Shiraishi","fromEmail":"nanako3@bluebottle.com","sentAt":"2007-06-16T22:26:08Z","receivedAt":"2007-06-16T22:26:08Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"If the remote repository does not have a \"current branch\", git-clone\nwas\nconfused and did not set up the resulting new repository correctly. \nIt did\nnot reset HEAD from the default 'master', and did not write the SHA1\nto the master branch.\n\nSigned-off-by: Nanako Shiraishi <nanako3@bluebottle.com>\n\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 3a41062..bd44ce1 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -377,6 +377,13 @@ then\n \t\t)\n \t)\n \n+\t# Upstream URL\n+\tgit-config remote.\"$origin\".url \"$repo\" &&\n+\n+\t# Set up the mappings to track the remote branches.\n+\tgit-config remote.\"$origin\".fetch \\\n+\t\t\"+refs/heads/*:$remote_top/*\" '^$' &&\n+\n \t# Write out remote.$origin config, and update our\n\"$head_points_at\".\n \tcase \"$head_points_at\" in\n \t?*)\n@@ -384,21 +391,20 @@ then\n \t\tgit-symbolic-ref HEAD \"refs/heads/$head_points_at\" &&\n \n \t\t# Tracking branch for the primary branch at the remote.\n-\t\torigin_track=\"$remote_top/$head_points_at\" &&\n \t\tgit-update-ref HEAD \"$head_sha1\" &&\n \n-\t\t# Upstream URL\n-\t\tgit-config remote.\"$origin\".url \"$repo\" &&\n-\n-\t\t# Set up the mappings to track the remote branches.\n-\t\tgit-config remote.\"$origin\".fetch \\\n-\t\t\t\"+refs/heads/*:$remote_top/*\" '^$' &&\n \t\trm -f \"refs/remotes/$origin/HEAD\"\n \t\tgit-symbolic-ref \"refs/remotes/$origin/HEAD\" \\\n \t\t\t\"refs/remotes/$origin/$head_points_at\" &&\n \n \t\tgit-config branch.\"$head_points_at\".remote \"$origin\" &&\n \t\tgit-config branch.\"$head_points_at\".merge\n\"refs/heads/$head_points_at\"\n+\t\t;;\n+\t'')\n+\t\t# Source had detached HEAD pointing nowhere\n+\t\tgit-update-ref --no-deref HEAD \"$head_sha1\" &&\n+\t\trm -f \"refs/remotes/$origin/HEAD\"\n+\t\t;;\n \tesac\n \n \tcase \"$no_checkout\" in\n-- \n1.5.2\n\n----------------------------------------------------------------------\nGet a free email address with REAL anti-spam protection.\nhttp://www.bluebottle.com\n"},{"id":"45203","messageId":"7vbqff1c3w.fsf@assigned-by-dhcp.pobox.com","threadId":"8620","inReplyTo":"200706162226.l5GMQBss004492@mi0.bluebottle.com","subject":"Re: [PATCH] Cloning from a repo without \"current branch\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-17T03:41:39Z","receivedAt":"2007-06-17T03:41:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@bluebottle.com> writes:\n\n> diff --git a/git-clone.sh b/git-clone.sh\n> index 3a41062..bd44ce1 100755\n> --- a/git-clone.sh\n> +++ b/git-clone.sh\n> @@ -377,6 +377,13 @@ then\n>  \t\t)\n>  \t)\n>  \n> +\t# Upstream URL\n> +\tgit-config remote.\"$origin\".url \"$repo\" &&\n> +\n> +\t# Set up the mappings to track the remote branches.\n> +\tgit-config remote.\"$origin\".fetch \\\n> +\t\t\"+refs/heads/*:$remote_top/*\" '^$' &&\n> +\n>  \t# Write out remote.$origin config, and update our\n> \"$head_points_at\".\n>  \tcase \"$head_points_at\" in\n>  \t?*)\n\nWhitespace breakage?\n\n> @@ -384,21 +391,20 @@ then\n>  \t\tgit-symbolic-ref HEAD \"refs/heads/$head_points_at\" &&\n>  \n>  \t\t# Tracking branch for the primary branch at the remote.\n> -\t\torigin_track=\"$remote_top/$head_points_at\" &&\n>  \t\tgit-update-ref HEAD \"$head_sha1\" &&\n>  \n> -\t\t# Upstream URL\n> -\t\tgit-config remote.\"$origin\".url \"$repo\" &&\n> -\n> -\t\t# Set up the mappings to track the remote branches.\n> -\t\tgit-config remote.\"$origin\".fetch \\\n> -\t\t\t\"+refs/heads/*:$remote_top/*\" '^$' &&\n>  \t\trm -f \"refs/remotes/$origin/HEAD\"\n>  \t\tgit-symbolic-ref \"refs/remotes/$origin/HEAD\" \\\n>  \t\t\t\"refs/remotes/$origin/$head_points_at\" &&\n>  \n>  \t\tgit-config branch.\"$head_points_at\".remote \"$origin\" &&\n>  \t\tgit-config branch.\"$head_points_at\".merge\n> \"refs/heads/$head_points_at\"\n> +\t\t;;\n\nAgain...?\n\n> +\t'')\n> +\t\t# Source had detached HEAD pointing nowhere\n> +\t\tgit-update-ref --no-deref HEAD \"$head_sha1\" &&\n> +\t\trm -f \"refs/remotes/$origin/HEAD\"\n> +\t\t;;\n>  \tesac\n>  \n>  \tcase \"$no_checkout\" in\n> -- \n> 1.5.2\n"},{"id":"45446","messageId":"200706202150.l5KLoHkE002843@mi0.bluebottle.com","threadId":"8620","inReplyTo":"7vbqff1c3w.fsf@assigned-by-dhcp.pobox.com","subject":"Re: [PATCH] Cloning from a repo without \"current branch\"","fromName":"Nanako Shiraishi","fromEmail":"nanako3@bluebottle.com","sentAt":"2007-06-20T21:50:17Z","receivedAt":"2007-06-20T21:50:17Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Junio C Hamano <gitster@pobox.com>:\n\n> Nanako Shiraishi <nanako3@bluebottle.com> writes:\n> \n> > diff --git a/git-clone.sh b/git-clone.sh\n> >  \t?*)\n> \n> Whitespace breakage?\n> \n> > @@ -384,21 +391,20 @@ then\n> >  \t\tgit-config branch.\"$head_points_at\".merge\n> > \"refs/heads/$head_points_at\"\n> > +\t\t;;\n> \n> Again...?\n\nSorry, I'll re-send from a different mail addr.\nIs it alright to send attachments?\n\n----------------------------------------------------------------------\nGet a free email account with anti spam protection.\nhttp://www.bluebottle.com\n"},{"id":"45449","messageId":"7vwsxy5kfg.fsf@assigned-by-dhcp.pobox.com","threadId":"8620","inReplyTo":"200706202150.l5KLoHkE002843@mi0.bluebottle.com","subject":"Re: [PATCH] Cloning from a repo without \"current branch\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-20T22:29:39Z","receivedAt":"2007-06-20T22:29:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@bluebottle.com> writes:\n\n> Quoting Junio C Hamano <gitster@pobox.com>:\n>\n>> Nanako Shiraishi <nanako3@bluebottle.com> writes:\n>> \n>> > diff --git a/git-clone.sh b/git-clone.sh\n>> >  \t?*)\n>> \n>> Whitespace breakage?\n>> \n>> > @@ -384,21 +391,20 @@ then\n>> >  \t\tgit-config branch.\"$head_points_at\".merge\n>> > \"refs/heads/$head_points_at\"\n>> > +\t\t;;\n>> \n>> Again...?\n>\n> Sorry, I'll re-send from a different mail addr.\n> Is it alright to send attachments?\n\nWell, the breakage was trivial enough to fix at my end; no need\nto resend.\n\nThanks for your patch; it is a real fix (well, at least one of\nthe necessary ones) to a breakage we discussed on the list\nrecently.\n"},{"id":"45466","messageId":"20070621050117.GF8477@spearce.org","threadId":"8620","inReplyTo":"7vk5tx5333.fsf@assigned-by-dhcp.pobox.com","subject":"Re: [PATCH] git-gui: use \"blame -w -C -C\" for \"where did it come from, originally?\"","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-06-21T05:01:17Z","receivedAt":"2007-06-21T05:01:17Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> The blame window shows \"who wrote the piece originally\" and \"who\n> moved it there\" in two columns.  In order to identify the former\n> more correctly, it helps to use the new -w option.\n...\n> diff --git a/lib/blame.tcl b/lib/blame.tcl\n> index 139171d..a412a8c 100644\n> --- a/lib/blame.tcl\n> +++ b/lib/blame.tcl\n> @@ -672,7 +672,7 @@ method _read_blame {fd cur_w cur_d cur_s} {\n>  \t\tclose $fd\n>  \t\tif {$cur_w eq $w_asim} {\n>  \t\t\t_exec_blame $this $w_amov @amov_data \\\n> -\t\t\t\t[list -M -C -C] \\\n> +\t\t\t\t[list -w -C -C] \\\n>  \t\t\t\t{ original location}\n>  \t\t} else {\n>  \t\t\tset current_fd {}\n> \n\nI've wanted to do this since you introduced `git blame -w`.  But I\ncan't use it, because I cannot trust that -w is there.  For example\nit is not in maint, but the new blame viewer from git-gui is.\n\nApply my --list-features patch to core Git and I'll activate -w in\ngit-gui when --list-features claims the 'blame-ignore-whitespace'\nfeature is available.\n\n;-)\n\n-- \nShawn.\n"},{"id":"45525","messageId":"alpine.LFD.0.98.0706211237220.3593@woody.linux-foundation.org","threadId":"8620","inReplyTo":"20070621050117.GF8477@spearce.org","subject":"Re: [PATCH] git-gui: use \"blame -w -C -C\" for \"where did it come from, originally?\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-06-21T19:39:30Z","receivedAt":"2007-06-21T19:39:30Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 21 Jun 2007, Shawn O. Pearce wrote:\n> \n> I've wanted to do this since you introduced `git blame -w`.  But I\n> can't use it, because I cannot trust that -w is there.  For example\n> it is not in maint, but the new blame viewer from git-gui is.\n\nActually, I think there's a different fundamental problem, namely that \ngit-gui doesn't seem to accept parameters.\n\nI'd personally rather *not* have git-gui make the -w/-M/-C choice for me. \nWhy don't you just allow the user to say? Sometimes I might want to see \nwho introduced broken whitespace. Let me say\n\n\tgit gui blame -w filename.c\n\nplease? Instead of making that choice for me, and then blaming git for \nsomething that wasn't git's problem.\n\n\t\tLinus\n"},{"id":"45526","messageId":"alpine.LFD.0.98.0706211243400.3593@woody.linux-foundation.org","threadId":"8620","inReplyTo":"alpine.LFD.0.98.0706211237220.3593@woody.linux-foundation.org","subject":"Re: [PATCH] git-gui: use \"blame -w -C -C\" for \"where did it come from, originally?\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-06-21T19:47:54Z","receivedAt":"2007-06-21T19:47:54Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 21 Jun 2007, Linus Torvalds wrote:\n> \n> I'd personally rather *not* have git-gui make the -w/-M/-C choice for me. \n> Why don't you just allow the user to say? Sometimes I might want to see \n> who introduced broken whitespace. Let me say\n> \n> \tgit gui blame -w filename.c\n> \n> please? Instead of making that choice for me, and then blaming git for \n> something that wasn't git's problem.\n\nSide note - this ended up being one reason why \"gitk\" is so good. It just \npassed down the arguments to \"git-rev-list\", and it allowed me to improve \non the original gitk without gitk ever even _realizing_ it was improved \nupon. All the pathname filtering etc was done without gitk ever learning \nabout it - it \"just worked\".\n\n\t\tLinus\n"},{"id":"45541","messageId":"20070622033456.GB17393@spearce.org","threadId":"8620","inReplyTo":"alpine.LFD.0.98.0706211243400.3593@woody.linux-foundation.org","subject":"Re: [PATCH] git-gui: use \"blame -w -C -C\" for \"where did it come from, originally?\"","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-06-22T03:34:57Z","receivedAt":"2007-06-22T03:34:57Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> wrote:\n> \n> On Thu, 21 Jun 2007, Linus Torvalds wrote:\n> > \n> > I'd personally rather *not* have git-gui make the -w/-M/-C choice for me. \n> > Why don't you just allow the user to say? Sometimes I might want to see \n> > who introduced broken whitespace. Let me say\n> > \n> > \tgit gui blame -w filename.c\n> > \n> > please? Instead of making that choice for me, and then blaming git for \n> > something that wasn't git's problem.\n> \n> Side note - this ended up being one reason why \"gitk\" is so good. It just \n> passed down the arguments to \"git-rev-list\", and it allowed me to improve \n> on the original gitk without gitk ever even _realizing_ it was improved \n> upon. All the pathname filtering etc was done without gitk ever learning \n> about it - it \"just worked\".\n\nHmm.  Good point about gitk.  We all know you would rather not hack\nTcl to enhance tools, because you would prefer to work directly in C.\n\nA lot of the stuff rev-list does in pure C does translate\ndirectly into gitk, and its one of the features that I also love\nmost about gitk.  Except --reverse; gitk doesn't really like to do\n`gitk --reverse --all`.  But it can be extremely amusing to run if\nyou are bored and have time to waste.\n\nHowever.  The new blame viewer supports two columns, and runs two\nblame passes to obtain the information for them.  I like that,\nbecause it offers up a lot of information in a single compact view.\nWhich column do I send the option(s) to?  Do I let the user specify\nwhich column to apply the options onto?\n\n  git gui blame --left='-C -C' --right=   filename.c    ;# default\n  git gui blame --left=-w      --right=-M filename.c    ;# not default\n\n? Or do I only show one column if the user supplies command line\noptions?  Doesn't that limit the tool?\n\n-- \nShawn.\n"}]}