git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix git-pull output message
@ 2005-09-28 10:02 Robert Watson
  2005-09-28 11:00 ` Junio C Hamano
  2005-09-28 15:29 ` Linus Torvalds
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Watson @ 2005-09-28 10:02 UTC (permalink / raw)
  To: git, Junio C Hamano

(git)$ git-pull
Fetching refs/heads/master from
http://www.kernel.org/pub/scm/git/git.git using http
* committish: 3cc35e29ec252d0dca1139106fbaa70cb9ad6ef1
  branch 'master' of http://www.kernel.org/pub/scm/git/git
* refs/heads/origin: same as branch 'master' of
http://www.kernel.org/pub/scm/git/git
Already up-to-date. Yeeah!

Notice that the git.git directory is truncated.  It seems the
intension is to truncate at the .git
directory level.  The following patch fixes it.

diff --git a/git-fetch.sh b/git-fetch.sh
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -70,7 +70,7 @@ append_fetch_head () {
     *)
        note_="$remote_name of " ;;
     esac
-    remote_1_=$(expr "$remote_" : '\(.*\)\.git/*$') &&
+    remote_1_=$(expr "$remote_" : '\(.*/\)\.git/*$') &&
        remote_="$remote_1_"
     note_="$note_$remote_"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix git-pull output message
  2005-09-28 10:02 [PATCH] Fix git-pull output message Robert Watson
@ 2005-09-28 11:00 ` Junio C Hamano
  2005-09-28 15:29 ` Linus Torvalds
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2005-09-28 11:00 UTC (permalink / raw)
  To: Robert Watson; +Cc: git

Robert Watson <robert.oo.watson@gmail.com> writes:

> Notice that the git.git directory is truncated.  It seems the
> intension is to truncate at the .git directory level.

c5434dead6a52a48c520dfa3d8ed24dc3673ab1a commit introduced this
behaviour, and we kept it ever since.

It may look a bit weird when it is applied to git.git/, but the
intention is to shorten the log message without losing much
information.  ".../torvalds/linux-2.6.git" is similarly
shortened to ".../torvalds/linux-2.6".

You can see 'git log' output in the kernel repository and look
for commit log messages of merge commits, and notice all those
repository names with trailing ".git" stripped.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix git-pull output message
  2005-09-28 10:02 [PATCH] Fix git-pull output message Robert Watson
  2005-09-28 11:00 ` Junio C Hamano
@ 2005-09-28 15:29 ` Linus Torvalds
  2005-09-29  8:48   ` Robert Watson
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2005-09-28 15:29 UTC (permalink / raw)
  To: Robert Watson; +Cc: git, Junio C Hamano



On Wed, 28 Sep 2005, Robert Watson wrote:
> 
> Notice that the git.git directory is truncated.  It seems the
> intension is to truncate at the .git
> directory level.  The following patch fixes it.

No, the intention really is to remove the ".git" at the end. At least 
that's how I use it.

I like seeing my merges say

    Merge branch 'for-linus' from master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband

even though the _real_ directory was ".../infiniband.git/", simply because 
the ".git" doesn't really add any extra information when you're already in 
git.

_outside_ of git, the ".git" tells you something: it tells you that you're 
entering a git archive. But when merging in git, that part is kind of 
taken for granted, isn't it?

This also matches what "git-receive-pack" and "git-upload-pack" does:

	...
        /* chdir to the directory. If that fails, try appending ".git" */
        if (chdir(dir) < 0) {
                if (chdir(mkpath("%s.git", dir)) < 0)
                        die("unable to cd to %s", dir);
        }

        /* If we have a ".git" directory, chdir to it */
        chdir(".git");
	...

Note how it _both_ will append ".git" to the directory name (if it can't 
find one without ".git" _and_ will try to chdir to a ".git" directory 
_within_ the directory name.

So if you use the native pack ssh interfaces, you really can say

	git pull master.kernel.org:.../infiniband

because the tools (well, the "native pack" ones - not the http/rsync/scp
ones) will automatically DTRT.

		Linus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix git-pull output message
  2005-09-28 15:29 ` Linus Torvalds
@ 2005-09-29  8:48   ` Robert Watson
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Watson @ 2005-09-29  8:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git, Junio C Hamano

On 9/28/05, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> On Wed, 28 Sep 2005, Robert Watson wrote:
> >
> > Notice that the git.git directory is truncated.  It seems the
> > intension is to truncate at the .git
> > directory level.  The following patch fixes it.
>
> No, the intention really is to remove the ".git" at the end. At least
> that's how I use it.
>
> I like seeing my merges say
>
>     Merge branch 'for-linus' from master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
>
> even though the _real_ directory was ".../infiniband.git/", simply because
> the ".git" doesn't really add any extra information when you're already in
> git.
>
> _outside_ of git, the ".git" tells you something: it tells you that you're
> entering a git archive. But when merging in git, that part is kind of
> taken for granted, isn't it?
>
> This also matches what "git-receive-pack" and "git-upload-pack" does:
>
>         ...
>         /* chdir to the directory. If that fails, try appending ".git" */
>         if (chdir(dir) < 0) {
>                 if (chdir(mkpath("%s.git", dir)) < 0)
>                         die("unable to cd to %s", dir);
>         }
>
>         /* If we have a ".git" directory, chdir to it */
>         chdir(".git");
>         ...
>
> Note how it _both_ will append ".git" to the directory name (if it can't
> find one without ".git" _and_ will try to chdir to a ".git" directory
> _within_ the directory name.
>
> So if you use the native pack ssh interfaces, you really can say
>
>         git pull master.kernel.org:.../infiniband
>
> because the tools (well, the "native pack" ones - not the http/rsync/scp
> ones) will automatically DTRT.
>
>                 Linus
>

Now, I understand it.  Thanks Linus and Junio.

Robertoo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-29  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-28 10:02 [PATCH] Fix git-pull output message Robert Watson
2005-09-28 11:00 ` Junio C Hamano
2005-09-28 15:29 ` Linus Torvalds
2005-09-29  8:48   ` Robert Watson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).