{"thread":{"id":"32166","subject":"[PATCH] emacs: make 'git-status' work with separate git dirs","startedAt":"2012-11-22T15:58:54Z","lastAt":"2012-11-26T23:30:52Z","messageCount":4,"participants":["Enrico Scholz","Junio C Hamano","Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"203643","messageId":"1353599934-23222-1-git-send-email-enrico.scholz@sigma-chemnitz.de","threadId":"32166","inReplyTo":null,"subject":"[PATCH] emacs: make 'git-status' work with separate git dirs","fromName":"Enrico Scholz","fromEmail":"enrico.scholz@sigma-chemnitz.de","sentAt":"2012-11-22T15:58:54Z","receivedAt":"2012-11-22T15:58:54Z","isPatch":true,"sender":{"key":"enrico.scholz@sigma-chemnitz.de","avatar":null},"body":"when trying 'M-x git-status' in a submodule created with recent (1.7.5+)\ngit, the command fails with\n\n| ... is not a git working tree\n\nThis is caused by creating submodules with '--separate-git-dir' but\nstill checking for a working tree by testing for a '.git' directory.\n\nThe patch fixes this by relaxing the existing detection a little bit.\n\nSigned-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>\n---\n contrib/emacs/git.el | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex 65c95d9..5ffc506 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -1671,7 +1671,7 @@ Commands:\n   \"Entry point into git-status mode.\"\n   (interactive \"DSelect directory: \")\n   (setq dir (git-get-top-dir dir))\n-  (if (file-directory-p (concat (file-name-as-directory dir) \".git\"))\n+  (if (file-exists-p (concat (file-name-as-directory dir) \".git\"))\n       (let ((buffer (or (and git-reuse-status-buffer (git-find-status-buffer dir))\n                         (create-file-buffer (expand-file-name \"*git-status*\" dir)))))\n         (switch-to-buffer buffer)\n-- \n1.7.11.7\n"},{"id":"203775","messageId":"7v4nkeyzfb.fsf@alter.siamese.dyndns.org","threadId":"32166","inReplyTo":"1353599934-23222-1-git-send-email-enrico.scholz@sigma-chemnitz.de","subject":"Re: [PATCH] emacs: make 'git-status' work with separate git dirs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-25T06:22:32Z","receivedAt":"2012-11-25T06:22:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Enrico Scholz <enrico.scholz@sigma-chemnitz.de> writes:\n\n> when trying 'M-x git-status' in a submodule created with recent (1.7.5+)\n> git, the command fails with\n>\n> | ... is not a git working tree\n>\n> This is caused by creating submodules with '--separate-git-dir' but\n> still checking for a working tree by testing for a '.git' directory.\n>\n> The patch fixes this by relaxing the existing detection a little bit.\n>\n> Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>\n> ---\n\nThis script already relies on the assumption that nobody sane would\ncreate a directory named \".git\" that is not a git repository, and\nthis loosens the assumption that nobody would create a file named\n\".git\", either.  So I would think it is a sane thing to do, but just\nin case if the area expert has better ideas, I am forwarding it.\n\nAck?\n\n>  contrib/emacs/git.el | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\n> index 65c95d9..5ffc506 100644\n> --- a/contrib/emacs/git.el\n> +++ b/contrib/emacs/git.el\n> @@ -1671,7 +1671,7 @@ Commands:\n>    \"Entry point into git-status mode.\"\n>    (interactive \"DSelect directory: \")\n>    (setq dir (git-get-top-dir dir))\n> -  (if (file-directory-p (concat (file-name-as-directory dir) \".git\"))\n> +  (if (file-exists-p (concat (file-name-as-directory dir) \".git\"))\n>        (let ((buffer (or (and git-reuse-status-buffer (git-find-status-buffer dir))\n>                          (create-file-buffer (expand-file-name \"*git-status*\" dir)))))\n>          (switch-to-buffer buffer)\n"},{"id":"203783","messageId":"87ehjit5ke.fsf@wine.dyndns.org","threadId":"32166","inReplyTo":"7v4nkeyzfb.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] emacs: make 'git-status' work with separate git dirs","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2012-11-25T09:06:25Z","receivedAt":"2012-11-25T09:06:25Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Enrico Scholz <enrico.scholz@sigma-chemnitz.de> writes:\n>\n>> when trying 'M-x git-status' in a submodule created with recent (1.7.5+)\n>> git, the command fails with\n>>\n>> | ... is not a git working tree\n>>\n>> This is caused by creating submodules with '--separate-git-dir' but\n>> still checking for a working tree by testing for a '.git' directory.\n>>\n>> The patch fixes this by relaxing the existing detection a little bit.\n>>\n>> Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>\n>> ---\n>\n> This script already relies on the assumption that nobody sane would\n> create a directory named \".git\" that is not a git repository, and\n> this loosens the assumption that nobody would create a file named\n> \".git\", either.  So I would think it is a sane thing to do, but just\n> in case if the area expert has better ideas, I am forwarding it.\n>\n> Ack?\n\nSure, that's fine.\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"},{"id":"203951","messageId":"7vboekosb7.fsf@alter.siamese.dyndns.org","threadId":"32166","inReplyTo":"87ehjit5ke.fsf@wine.dyndns.org","subject":"Re: [PATCH] emacs: make 'git-status' work with separate git dirs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-26T23:30:52Z","receivedAt":"2012-11-26T23:30:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexandre Julliard <julliard@winehq.org> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Enrico Scholz <enrico.scholz@sigma-chemnitz.de> writes:\n>>\n>>> when trying 'M-x git-status' in a submodule created with recent (1.7.5+)\n>>> git, the command fails with\n>>>\n>>> | ... is not a git working tree\n>>>\n>>> This is caused by creating submodules with '--separate-git-dir' but\n>>> still checking for a working tree by testing for a '.git' directory.\n>>>\n>>> The patch fixes this by relaxing the existing detection a little bit.\n>>>\n>>> Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>\n>>> ---\n>>\n>> This script already relies on the assumption that nobody sane would\n>> create a directory named \".git\" that is not a git repository, and\n>> this loosens the assumption that nobody would create a file named\n>> \".git\", either.  So I would think it is a sane thing to do, but just\n>> in case if the area expert has better ideas, I am forwarding it.\n>>\n>> Ack?\n>\n> Sure, that's fine.\n\nThanks, both.  Applied.\n"}]}