git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git commit/push can fail silently when clone omits ".git"
@ 2012-11-04 19:50 Jeffrey S. Haemer
  2012-11-08 18:56 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Jeffrey S. Haemer @ 2012-11-04 19:50 UTC (permalink / raw)
  To: Git Issues

[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]

Ladies and Gentlemen,

I'm running git 1.7.9.5 on Ubuntu 12.04.1 LTS

I got bitten by what follows. Yes, it's an edge case. Yes I now understand
why it does what it does. Yes the right answer is "Don't do that, Jeff." :-)

Still, it took me a little time to figure out what I'd done wrong because
the failure is silent, so I thought I'd document it. Perhaps there's even
some way to issue an error message for cases like this.

The attached test script shows the issue in detail, but here's the basic
failure:

$ ls
hello.git
$ git clone hello # *Mistake!* Succeeds, but should have cloned "hello.git"
or into something else.
$ cd hello; touch foo; git add foo; git commit -am"add a new file"
$ git status # says I'm a rev ahead of the origin
$ git push # nothing pushed
$ git status # says everything's okay

At this point hello/foo still exists, there's nothing to commit, git diff
origin/master reports nothing, yet foo was never pushed to hello.git.

HTH!

--
Jeffrey Haemer <jeffrey.haemer@gmail.com>
720-837-8908 [cell], http://seejeffrun.blogspot.com [blog],
http://www.youtube.com/user/goyishekop [vlog]
פרייהייט? דאס איז יאַנג דינען וואָרט.

[-- Attachment #2: clone-from-suffixless-gitrepo-issue.sh --]
[-- Type: application/x-sh, Size: 2193 bytes --]

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

end of thread, other threads:[~2012-11-13  8:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-04 19:50 git commit/push can fail silently when clone omits ".git" Jeffrey S. Haemer
2012-11-08 18:56 ` Jeff King
2012-11-09 18:42   ` Heiko Voigt
2012-11-13  8:32     ` [PATCH 0/3] fix cloning superprojects from "." Heiko Voigt
2012-11-13  8:34       ` [PATCH 1/3] Fix relative submodule setup of submodule tests Heiko Voigt
2012-11-13  8:35       ` [PATCH 2/3] ensure that relative submodule url needs ./ or ../ Heiko Voigt
2012-11-13  8:35       ` [PATCH 3/3] fix corner case for relative submodule path calculation Heiko Voigt

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).