{"thread":{"id":"19991","subject":"[PATCH] Documentation: update description of shell aliases","startedAt":"2009-07-01T16:00:31Z","lastAt":"2009-07-02T07:21:31Z","messageCount":4,"participants":["Sitaram Chamarty","Junio C Hamano","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"117301","messageId":"2e24e5b90907010900r23ddc8dfl67dee569b508a4b7@mail.gmail.com","threadId":"19991","inReplyTo":null,"subject":"[PATCH] Documentation: update description of shell aliases","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-07-01T16:00:31Z","receivedAt":"2009-07-01T16:00:31Z","isPatch":true,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"Aliases that invoke shell commands start from the top-level directory,\nbut this was not documented.\n\nSigned-off-by: Sitaram Chamarty <sitaramc@gmail.com>\n---\n Documentation/config.txt |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 2fecbe3..bf97e1d 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -456,7 +456,9 @@ If the alias expansion is prefixed with an\nexclamation point,\n it will be treated as a shell command.  For example, defining\n \"alias.new = !gitk --all --not ORIG_HEAD\", the invocation\n \"git new\" is equivalent to running the shell command\n-\"gitk --all --not ORIG_HEAD\".\n+\"gitk --all --not ORIG_HEAD\".  Note that shell commands will be\n+executed from the top-level directory of a repository, which may\n+not necessarily be the current directory.\n\n apply.whitespace::\n \tTells 'git-apply' how to handle whitespaces, in the same way\n-- \n1.6.3.3\n"},{"id":"117308","messageId":"7v7hysl0x8.fsf@alter.siamese.dyndns.org","threadId":"19991","inReplyTo":"2e24e5b90907010900r23ddc8dfl67dee569b508a4b7@mail.gmail.com","subject":"Re: [PATCH] Documentation: update description of shell aliases","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-01T18:21:07Z","receivedAt":"2009-07-01T18:21:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n> Aliases that invoke shell commands start from the top-level directory,\n> but this was not documented.\n\nCould you please also think if it is worth mentioning what happens when\nyou do not even have a top-level directory?  I.e. in a bare repository.\n"},{"id":"117334","messageId":"2e24e5b90907011757r498b8c52v4cf5dfb7016bf8b5@mail.gmail.com","threadId":"19991","inReplyTo":"7v7hysl0x8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Documentation: update description of shell aliases","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-07-02T00:57:19Z","receivedAt":"2009-07-02T00:57:19Z","isPatch":true,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Wed, Jul 1, 2009 at 11:51 PM, Junio C Hamano<gitster@pobox.com> wrote:\n> Sitaram Chamarty <sitaramc@gmail.com> writes:\n>\n>> Aliases that invoke shell commands start from the top-level directory,\n>> but this was not documented.\n>\n> Could you please also think if it is worth mentioning what happens when\n> you do not even have a top-level directory?  I.e. in a bare repository.\n\nYes I thought about it.  I decided not to add that because\nit is:\n\n  - not common enough (how many new users fiddle in bare\n    repos?)\n\n  - not surprising enough (I did test it; it just uses the\n    current -- bare -- directory, as even a new user would\n    expect)\n\n(In contrast, the part I added _was_ somewhat surprising.)\n\nAnd if we go that far, why not also document what happens\nwith various combinations of $PWD,$GIT_DIR and\n$GIT_WORK_TREE?  I did not get a chance to test those, but\nif you think we should add those also, I will do so and\ndocument what happens.\n\nI just think it may be a bit overkill, but if you think it's\nnot, and it adds value, just say so and I will test and\ndocument it.\n"},{"id":"117345","messageId":"4A4C5FFB.90302@op5.se","threadId":"19991","inReplyTo":"2e24e5b90907011757r498b8c52v4cf5dfb7016bf8b5@mail.gmail.com","subject":"Re: [PATCH] Documentation: update description of shell aliases","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2009-07-02T07:21:31Z","receivedAt":"2009-07-02T07:21:31Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Sitaram Chamarty wrote:\n> On Wed, Jul 1, 2009 at 11:51 PM, Junio C Hamano<gitster@pobox.com> wrote:\n>> Sitaram Chamarty <sitaramc@gmail.com> writes:\n>>\n>>> Aliases that invoke shell commands start from the top-level directory,\n>>> but this was not documented.\n>> Could you please also think if it is worth mentioning what happens when\n>> you do not even have a top-level directory?  I.e. in a bare repository.\n> \n> Yes I thought about it.  I decided not to add that because\n> it is:\n> \n>   - not common enough (how many new users fiddle in bare\n>     repos?)\n> \n\nI do that quite a lot, but I can't recall ever using an alias\nin a bare repo. It would be odd if I did, as the only alias I've\ngot is this:\n\n   alias.wsfix=!git diff HEAD >P.diff && git reset --hard HEAD && git apply --whitespace=fix P.diff && rm -f P.diff\n\nwhich isn't always doing the right thing even in a non-bare\nrepository, and never in a bare one.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"}]}