# [PATCH] git-fetch should not strip off ".git" extension

13 messages from 2008-10-18 to 2008-10-22. Participants: Leo Razoumov, Andreas Ericsson, Junio C Hamano, Alex Riesen.
Thread: https://gitlist.dev/t/15949

## Leo Razoumov, 2008-10-18 11:59

Subject: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <ee2a733e0810180459m5fd20365s3c27bea5c1f3f704@mail.gmail.com>
URL: https://gitlist.dev/e/ee2a733e0810180459m5fd20365s3c27bea5c1f3f704%40mail.gmail.com

```
When source git repository has extension ".git" like in "MyRepo.git"
"git fetch" will drop ".git" extension and refer to it as "MyRepo".

Example:

sh$ git fetch -v ../MyRepo.git master
From ../MyRepo
 * branch            master     -> FETCH_HEAD

sh$ cat .git/FETCH_HEAD
6eb10bd105f2ef7f64c595100c0a850c5b3cfeb9           branch 'master' of ../MyRepo

Please, note that "git fetch" writes "../MyRepo" instead of "../MyRepo.git"

My workflow makes it convenient to have two distinct repositories
(1) "MyRepo"      => where I work daily (WIP)
(2) "MyRepo.git" => --bare repository accessible to others. "MyRepo"
pushes ready changes to "MyRepo.git"
Dropping ".git" extension causes confusion between these two quite
similarly named repositories.

This problem can be easily solved by the patch below that removes the
code that strips off ".git" extension.

--Leo--

----8<-------------------

 builtin-fetch--tool.c |    2 --
 builtin-fetch.c       |    2 --
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 7460ab7..5d0b95f 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -160,8 +160,6 @@ static int append_fetch_head(FILE *fp,
 	for (i = remote_len - 1; remote[i] == '/' && 0 <= i; i--)
 		;
 	remote_len = i + 1;
-	if (4 < i && !strncmp(".git", remote + i - 3, 4))
-		remote_len = i - 3;

 	note_len = 0;
 	if (*what) {
diff --git a/builtin-fetch.c b/builtin-fetch.c
index ee93d3a..28123a5 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -348,8 +348,6 @@ static int store_updated_refs(const char *url,
const char *remote_name,
 		for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
 			;
 		url_len = i + 1;
-		if (4 < i && !strncmp(".git", url + i - 3, 4))
-			url_len = i - 3;

 		note_len = 0;
 		if (*what) {

```

## Andreas Ericsson, 2008-10-20 10:36

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <48FC5F1B.1050608@op5.se>
URL: https://gitlist.dev/e/48FC5F1B.1050608%40op5.se
In-Reply-To: <ee2a733e0810180459m5fd20365s3c27bea5c1f3f704@mail.gmail.com>

```
Leo Razoumov wrote:
> When source git repository has extension ".git" like in "MyRepo.git"
> "git fetch" will drop ".git" extension and refer to it as "MyRepo".
> 
> Example:
> 
> sh$ git fetch -v ../MyRepo.git master
> From ../MyRepo
>  * branch            master     -> FETCH_HEAD
> 
> sh$ cat .git/FETCH_HEAD
> 6eb10bd105f2ef7f64c595100c0a850c5b3cfeb9           branch 'master' of ../MyRepo
> 
> Please, note that "git fetch" writes "../MyRepo" instead of "../MyRepo.git"
> 
> My workflow makes it convenient to have two distinct repositories
> (1) "MyRepo"      => where I work daily (WIP)
> (2) "MyRepo.git" => --bare repository accessible to others. "MyRepo"
> pushes ready changes to "MyRepo.git"
> Dropping ".git" extension causes confusion between these two quite
> similarly named repositories.
> 
> This problem can be easily solved by the patch below that removes the
> code that strips off ".git" extension.
> 
> --Leo--
> 
> ----8<-------------------
> 
>  builtin-fetch--tool.c |    2 --
>  builtin-fetch.c       |    2 --
>  2 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
> index 7460ab7..5d0b95f 100644
> --- a/builtin-fetch--tool.c
> +++ b/builtin-fetch--tool.c
> @@ -160,8 +160,6 @@ static int append_fetch_head(FILE *fp,
>  	for (i = remote_len - 1; remote[i] == '/' && 0 <= i; i--)
>  		;
>  	remote_len = i + 1;
> -	if (4 < i && !strncmp(".git", remote + i - 3, 4))
> -		remote_len = i - 3;
> 
>  	note_len = 0;
>  	if (*what) {
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index ee93d3a..28123a5 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> @@ -348,8 +348,6 @@ static int store_updated_refs(const char *url,
> const char *remote_name,
>  		for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
>  			;
>  		url_len = i + 1;
> -		if (4 < i && !strncmp(".git", url + i - 3, 4))
> -			url_len = i - 3;
> 

Will this still play nicely with

   git clone foo.git

?

Otherwise, please also fix the fallout from this patch.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

```

## Leo Razoumov, 2008-10-20 15:08

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <ee2a733e0810200808y657fe3d7y3158bfc00aa5e82a@mail.gmail.com>
URL: https://gitlist.dev/e/ee2a733e0810200808y657fe3d7y3158bfc00aa5e82a%40mail.gmail.com
In-Reply-To: <48FC5F1B.1050608@op5.se>

```
On 10/20/08, Andreas Ericsson <ae@op5.se> wrote:
> [..snip..]]
>  Will this still play nicely with
>
>   git clone foo.git
>
>  ?
>
>  Otherwise, please also fix the fallout from this patch.
>
>  --

Andreas,
thanks for the comment. I have been testing this patch for over two
weeks already and so far encountered no problems. I routinely perform
"git clone foo.git" and it works correctly creating new repo "foo" and
properly populating it.

--Leo--

```

## Junio C Hamano, 2008-10-20 18:37

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <7vzlkz2jv7.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzlkz2jv7.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <48FC5F1B.1050608@op5.se>

```
Andreas Ericsson <ae@op5.se> writes:

>>...
>>
>>  builtin-fetch--tool.c |    2 --
>>  builtin-fetch.c       |    2 --
>>  2 files changed, 0 insertions(+), 4 deletions(-)
>>
>> diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
>> index 7460ab7..5d0b95f 100644
>> --- a/builtin-fetch--tool.c
>> +++ b/builtin-fetch--tool.c
>> @@ -160,8 +160,6 @@ static int append_fetch_head(FILE *fp,
>>  	for (i = remote_len - 1; remote[i] == '/' && 0 <= i; i--)
>>  		;
>>  	remote_len = i + 1;
>> -	if (4 < i && !strncmp(".git", remote + i - 3, 4))
>> -		remote_len = i - 3;
>>
>>  	note_len = 0;
>>  	if (*what) {
>> diff --git a/builtin-fetch.c b/builtin-fetch.c
>> index ee93d3a..28123a5 100644
>> --- a/builtin-fetch.c
>> +++ b/builtin-fetch.c
>> @@ -348,8 +348,6 @@ static int store_updated_refs(const char *url,
>> const char *remote_name,
>>  		for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
>>  			;
>>  		url_len = i + 1;
>> -		if (4 < i && !strncmp(".git", url + i - 3, 4))
>> -			url_len = i - 3;
>>
> 
> Will this still play nicely with
>
>   git clone foo.git
>
> ?

I think it would.

As far as I can tell, the only thing the patch changes is to disable the
long established "repository name clean-up" feature in the autogenerated
merge messages (iow, input to "fmt-merge-msg").

```

## Leo Razoumov, 2008-10-21 10:23

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <ee2a733e0810210323j249c3460x881af6d6aefc647c@mail.gmail.com>
URL: https://gitlist.dev/e/ee2a733e0810210323j249c3460x881af6d6aefc647c%40mail.gmail.com
In-Reply-To: <7vzlkz2jv7.fsf@gitster.siamese.dyndns.org>

```
On 10/20/08, Junio C Hamano <gitster@pobox.com> wrote:
> Andreas Ericsson <ae@op5.se> writes:
>
>  >>...
>
> >>
>  >>  builtin-fetch--tool.c |    2 --
>  >>  builtin-fetch.c       |    2 --
>  >>  2 files changed, 0 insertions(+), 4 deletions(-)
>  >>
>  >> diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
>  >> index 7460ab7..5d0b95f 100644
>  >> --- a/builtin-fetch--tool.c
>  >> +++ b/builtin-fetch--tool.c
>  >> @@ -160,8 +160,6 @@ static int append_fetch_head(FILE *fp,
>  >>      for (i = remote_len - 1; remote[i] == '/' && 0 <= i; i--)
>  >>              ;
>  >>      remote_len = i + 1;
>  >> -    if (4 < i && !strncmp(".git", remote + i - 3, 4))
>  >> -            remote_len = i - 3;
>  >>
>  >>      note_len = 0;
>  >>      if (*what) {
>  >> diff --git a/builtin-fetch.c b/builtin-fetch.c
>  >> index ee93d3a..28123a5 100644
>  >> --- a/builtin-fetch.c
>  >> +++ b/builtin-fetch.c
>  >> @@ -348,8 +348,6 @@ static int store_updated_refs(const char *url,
>  >> const char *remote_name,
>  >>              for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
>  >>                      ;
>  >>              url_len = i + 1;
>  >> -            if (4 < i && !strncmp(".git", url + i - 3, 4))
>  >> -                    url_len = i - 3;
>  >>
>  >
>  > Will this still play nicely with
>  >
>  >   git clone foo.git
>  >
>  > ?
>
>
> I think it would.
>
>  As far as I can tell, the only thing the patch changes is to disable the
>  long established "repository name clean-up" feature in the autogenerated
>  merge messages (iow, input to "fmt-merge-msg").

Even though the old behavior is "long established", it introduces
unnecessary ambiguity. If I have two repos

(1) Foo      #private repo where I do my daily work
(2) Foo.git #exported public repo

the current behavior makes git messages confuse the repos.

--Leo--

```

## Junio C Hamano, 2008-10-21 16:56

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <7vej29zy2r.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vej29zy2r.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <ee2a733e0810210323j249c3460x881af6d6aefc647c@mail.gmail.com>

```
"Leo Razoumov" <slonik.az@gmail.com> writes:

> Even though the old behavior is "long established", it introduces
> unnecessary ambiguity. If I have two repos
> ...

Of course.  Now you know why people don't name such a pair of repositories
like that ;-).

```

## Alex Riesen, 2008-10-21 22:06

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <81b0412b0810211506y400ba750k2613ba19f01fb57@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0810211506y400ba750k2613ba19f01fb57%40mail.gmail.com
In-Reply-To: <7vej29zy2r.fsf@gitster.siamese.dyndns.org>

```
2008/10/21 Junio C Hamano <gitster@pobox.com>:
> "Leo Razoumov" <slonik.az@gmail.com> writes:
>
>> Even though the old behavior is "long established", it introduces
>> unnecessary ambiguity. If I have two repos
>> ...
>
> Of course.  Now you know why people don't name such a pair of repositories
> like that ;-).

FWIW, I support Leo on that. The "established" behavior is stupid.

```

## Junio C Hamano, 2008-10-21 22:36

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <7vd4htwp6v.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd4htwp6v.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <81b0412b0810211506y400ba750k2613ba19f01fb57@mail.gmail.com>

```
"Alex Riesen" <raa.lkml@gmail.com> writes:

> 2008/10/21 Junio C Hamano <gitster@pobox.com>:
>> "Leo Razoumov" <slonik.az@gmail.com> writes:
>>
>>> Even though the old behavior is "long established", it introduces
>>> unnecessary ambiguity. If I have two repos
>>> ...
>>
>> Of course.  Now you know why people don't name such a pair of repositories
>> like that ;-).
>
> FWIW, I support Leo on that. The "established" behavior is stupid.

I am not inclined to respond to such an emotional argument.  On the other
hand, it is fair to say that the existing behaviour is established,
because it is backed by a long history, which you can objectively verify.

If you think about it deeper, you will realize that it is not even clear
if it is "stupid".

More importantly, the behaviour is consistent with the way how "git fetch"
and "git clone" DWIMs the repository name by suffixing .git when the input
lacks it.  And this DWIMmery comes from the expectations that:

 (1) people name their repository project.git; and

 (2) people like using and seeing short names (iow, "clone
     git://$somewhere/project" is preferred over "clone
     git://$somewhere/project.git");

If a repository whose real location is git://$somewhere/project.git is
cloned/fetched as git://$somewhere/project by people, recording the merge
source using the shorter name used by people to fetch from it is more
consistent.  The patch breaks this consistency [*1*].

What is clear is that you would confuse yourself if you have two
repositories A and A.git next to each other, and that is primarily because
it breaks the above expectation.

git core-level rarely imposes such policies, but what Porcelains do is a
different matter.

Hence the suggestion: don't do it.

[Footnote]

*1* It would be a different matter if the patch at the same time removed
the fetch/clone DWIMmery.  At least such a patch would be internally self
consistent.

```

## Alex Riesen, 2008-10-21 22:43

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <81b0412b0810211543p6cb8c4ej49fb7fe70c3e2917@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0810211543p6cb8c4ej49fb7fe70c3e2917%40mail.gmail.com
In-Reply-To: <7vd4htwp6v.fsf@gitster.siamese.dyndns.org>

```
2008/10/22 Junio C Hamano <gitster@pobox.com>:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>>
>> FWIW, I support Leo on that. The "established" behavior is stupid.
>
> I am not inclined to respond to such an emotional argument.  On the other
> hand, it is fair to say that the existing behaviour is established,
> because it is backed by a long history, which you can objectively verify.

I found it illogical (well, stupid) and inconvinient

> *1* It would be a different matter if the patch at the same time removed
> the fetch/clone DWIMmery.  At least such a patch would be internally self
> consistent.

Good idea.

```

## Junio C Hamano, 2008-10-21 23:35

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <7v8wshwmgt.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v8wshwmgt.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <7vd4htwp6v.fsf@gitster.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> writes:

> More importantly, the behaviour is consistent with the way how "git fetch"
> and "git clone" DWIMs the repository name by suffixing .git when the input
> lacks it.  And this DWIMmery comes from the expectations that:
>
>  (1) people name their repository project.git; and
>
>  (2) people like using and seeing short names (iow, "clone
>      git://$somewhere/project" is preferred over "clone
>      git://$somewhere/project.git");
>
> If a repository whose real location is git://$somewhere/project.git is
> cloned/fetched as git://$somewhere/project by people, recording the merge
> source using the shorter name used by people to fetch from it is more
> consistent.  The patch breaks this consistency [*1*].
> ...
> [Footnote]
>
> *1* It would be a different matter if the patch at the same time removed
> the fetch/clone DWIMmery.  At least such a patch would be internally self
> consistent.

Actually, after looking at what the involved codepaths do, I am inclined
to change my mind.  Somehow I thought the transport.c infrastructure DWIMs
and uses the result of DWIMmery throughout the program (iow, at the point
in the codepath the patch touches, we cannot tell what the user originally
asked for), which is not the case at all.  That changes everything.

The current behaviour is Ok if you match your behaviour to the original
expectations, but:

 * if you clone from "git://$somewhere/project" originally, your
   remote.origin.url will not end with ".git";

 * or equivalently, if your remote.origin.url does not end with ".git".

and when you fetch in such a repository with or without the patch, the
results are the same.  URL without trailing ".git".

So the change in the behaviour is only when you originally explicitly
asked to clone "git://$somewhere/project.git".  With the change, that wish
is preserved.  Without the change, ".git" is unconditionally dropped.

The situation is the same if you explicitly ask to fetch from a URL that
ends with ".git" (or "/.git").  With the change, the explicit ".git" is
preserved; without it, it is dropped.

So I now think the patch (if it were massaged into an applicable shape
with proper log message and sign-off) is an improvement.

Alex, thanks for sanity checking ;-)

```

## Andreas Ericsson, 2008-10-22 07:55

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <48FEDC63.8090104@op5.se>
URL: https://gitlist.dev/e/48FEDC63.8090104%40op5.se
In-Reply-To: <81b0412b0810211543p6cb8c4ej49fb7fe70c3e2917@mail.gmail.com>

```
Alex Riesen wrote:
> 2008/10/22 Junio C Hamano <gitster@pobox.com>:
>> "Alex Riesen" <raa.lkml@gmail.com> writes:
>>> FWIW, I support Leo on that. The "established" behavior is stupid.
>> I am not inclined to respond to such an emotional argument.  On the other
>> hand, it is fair to say that the existing behaviour is established,
>> because it is backed by a long history, which you can objectively verify.
> 
> I found it illogical (well, stupid) and inconvinient
> 
>> *1* It would be a different matter if the patch at the same time removed
>> the fetch/clone DWIMmery.  At least such a patch would be internally self
>> consistent.
> 
> Good idea.

No. Bad idea. That would not only break people's fetch configurations if
they've done clone on repos without passing .git, but also mean users
would have to remember if a particular server names their bare repos
"project.git".

If you remove *all* DWIMmery from fetch/clone, you'd also break people's
expectations when they're fetching from each other, as they'd have to pass
"git://devpeer/project/.git" instead of just "git://devpeer/project", which
is what *looks* sane.

A good idea would be to always report the name the user used. 'git clone'
already does that, recording the non-DWIMmed URL in the remotes config.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

```

## Leo Razoumov, 2008-10-22 11:35

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <ee2a733e0810220435v5f1bfa62y508f78f2d9bef8ba@mail.gmail.com>
URL: https://gitlist.dev/e/ee2a733e0810220435v5f1bfa62y508f78f2d9bef8ba%40mail.gmail.com
In-Reply-To: <7vd4htwp6v.fsf@gitster.siamese.dyndns.org>

```
On 10/21/08, Junio C Hamano <gitster@pobox.com> wrote:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
>  > 2008/10/21 Junio C Hamano <gitster@pobox.com>:
>  >> "Leo Razoumov" <slonik.az@gmail.com> writes:
>  >>
>  >>> Even though the old behavior is "long established", it introduces
>  >>> unnecessary ambiguity. If I have two repos
>  >>> ...
>  >>
>  >> Of course.  Now you know why people don't name such a pair of repositories
>  >> like that ;-).
>  >
>  > FWIW, I support Leo on that. The "established" behavior is stupid.
>
>
> I am not inclined to respond to such an emotional argument.  On the other
>  hand, it is fair to say that the existing behaviour is established,
>  because it is backed by a long history, which you can objectively verify.
>
>  If you think about it deeper, you will realize that it is not even clear
>  if it is "stupid".
>
>  More importantly, the behaviour is consistent with the way how "git fetch"
>  and "git clone" DWIMs the repository name by suffixing .git when the input
>  lacks it.  And this DWIMmery comes from the expectations that:
>
>   (1) people name their repository project.git; and
>
>   (2) people like using and seeing short names (iow, "clone
>      git://$somewhere/project" is preferred over "clone
>      git://$somewhere/project.git");
>
>  If a repository whose real location is git://$somewhere/project.git is
>  cloned/fetched as git://$somewhere/project by people, recording the merge
>  source using the shorter name used by people to fetch from it is more
>  consistent.  The patch breaks this consistency [*1*].
>
>  What is clear is that you would confuse yourself if you have two
>  repositories A and A.git next to each other, and that is primarily because
>  it breaks the above expectation.
>
>  git core-level rarely imposes such policies, but what Porcelains do is a
>  different matter.
>
>  Hence the suggestion: don't do it.
>
>  [Footnote]
>
>  *1* It would be a different matter if the patch at the same time removed
>  the fetch/clone DWIMmery.  At least such a patch would be internally self
>  consistent.
>

I think this discussion went in the direction of "correct" versus
"convent". I, personally, will choose correct over convenient any
time. Different people use git for different projects and their
expectations differ in this regard. In my case
after I do "git clone Foo.git" I get "Foo" repo side-by-side with
"Foo.git" and the ambiguity becomes apparent.

Regarding your footnote *1*. I agree with your suggestions and I can
improve the patch in the following way:

(1) Fetch/clone messages/comments will refer to the source/destination
repos by their complete names without stripping off any parts
(2) Searching for a source repo, clone/fetch will first try an exact
match and if it fails it will remove/add ".git" suffix and

```

## Leo Razoumov, 2008-10-22 11:50

Subject: Re: [PATCH] git-fetch should not strip off ".git" extension
Message-ID: <ee2a733e0810220450i20dc81c5j488b513b5c0b781e@mail.gmail.com>
URL: https://gitlist.dev/e/ee2a733e0810220450i20dc81c5j488b513b5c0b781e%40mail.gmail.com
In-Reply-To: <7vd4htwp6v.fsf@gitster.siamese.dyndns.org>

```
My apologies!! I hit send button by mistake before message was
complete. Please, see below a completed version.
--Leo--

On 10/21/08, Junio C Hamano <gitster@pobox.com> wrote:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
>  > 2008/10/21 Junio C Hamano <gitster@pobox.com>:
>  >> "Leo Razoumov" <slonik.az@gmail.com> writes:
>  >>
>  >>> Even though the old behavior is "long established", it introduces
>  >>> unnecessary ambiguity. If I have two repos
>  >>> ...
>  >>
>  >> Of course.  Now you know why people don't name such a pair of repositories
>  >> like that ;-).
>  >
>  > FWIW, I support Leo on that. The "established" behavior is stupid.
>
>
> I am not inclined to respond to such an emotional argument.  On the other
>  hand, it is fair to say that the existing behaviour is established,
>  because it is backed by a long history, which you can objectively verify.
>
>  If you think about it deeper, you will realize that it is not even clear
>  if it is "stupid".
>
>  More importantly, the behaviour is consistent with the way how "git fetch"
>  and "git clone" DWIMs the repository name by suffixing .git when the input
>  lacks it.  And this DWIMmery comes from the expectations that:
>
>   (1) people name their repository project.git; and
>
>   (2) people like using and seeing short names (iow, "clone
>      git://$somewhere/project" is preferred over "clone
>      git://$somewhere/project.git");
>
>  If a repository whose real location is git://$somewhere/project.git is
>  cloned/fetched as git://$somewhere/project by people, recording the merge
>  source using the shorter name used by people to fetch from it is more
>  consistent.  The patch breaks this consistency [*1*].
>
>  What is clear is that you would confuse yourself if you have two
>  repositories A and A.git next to each other, and that is primarily because
>  it breaks the above expectation.
>
>  git core-level rarely imposes such policies, but what Porcelains do is a
>  different matter.
>
>  Hence the suggestion: don't do it.
>
>  [Footnote]
>
>  *1* It would be a different matter if the patch at the same time removed
>  the fetch/clone DWIMmery.  At least such a patch would be internally self
>  consistent.
>

I think this discussion went in the direction of "correct" versus
"convent". I, personally, will choose correct over convenient any
time. Different people use git for different projects and their
expectations differ in this regard. In my case
after I do "git clone Foo.git" I get "Foo" repo side-by-side with
"Foo.git" and the ambiguity becomes apparent.

Regarding your footnote *1*. I agree with your suggestions and I can
improve the patch in the following way:

(P1) Fetch/clone messages/records will refer to the source/destination
repos by their complete names without stripping off any parts of the name.

(P2) Searching for a source repo, clone/fetch will first try an exact
match and if it fails it will remove/add ".git" suffix as needed and retry.

Item (P2) will provide the convenience, while item (P1) still
guarantees correctness.

Please, let me know if such approach is more satisfactory.

--Leo--

```
