git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation: update description of shell aliases
@ 2009-07-01 16:00 Sitaram Chamarty
  2009-07-01 18:21 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Sitaram Chamarty @ 2009-07-01 16:00 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List

Aliases that invoke shell commands start from the top-level directory,
but this was not documented.

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
---
 Documentation/config.txt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 2fecbe3..bf97e1d 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -456,7 +456,9 @@ If the alias expansion is prefixed with an
exclamation point,
 it will be treated as a shell command.  For example, defining
 "alias.new = !gitk --all --not ORIG_HEAD", the invocation
 "git new" is equivalent to running the shell command
-"gitk --all --not ORIG_HEAD".
+"gitk --all --not ORIG_HEAD".  Note that shell commands will be
+executed from the top-level directory of a repository, which may
+not necessarily be the current directory.

 apply.whitespace::
 	Tells 'git-apply' how to handle whitespaces, in the same way
-- 
1.6.3.3

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

* Re: [PATCH] Documentation: update description of shell aliases
  2009-07-01 16:00 [PATCH] Documentation: update description of shell aliases Sitaram Chamarty
@ 2009-07-01 18:21 ` Junio C Hamano
  2009-07-02  0:57   ` Sitaram Chamarty
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2009-07-01 18:21 UTC (permalink / raw)
  To: Sitaram Chamarty; +Cc: Git Mailing List

Sitaram Chamarty <sitaramc@gmail.com> writes:

> Aliases that invoke shell commands start from the top-level directory,
> but this was not documented.

Could you please also think if it is worth mentioning what happens when
you do not even have a top-level directory?  I.e. in a bare repository.

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

* Re: [PATCH] Documentation: update description of shell aliases
  2009-07-01 18:21 ` Junio C Hamano
@ 2009-07-02  0:57   ` Sitaram Chamarty
  2009-07-02  7:21     ` Andreas Ericsson
  0 siblings, 1 reply; 4+ messages in thread
From: Sitaram Chamarty @ 2009-07-02  0:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

On Wed, Jul 1, 2009 at 11:51 PM, Junio C Hamano<gitster@pobox.com> wrote:
> Sitaram Chamarty <sitaramc@gmail.com> writes:
>
>> Aliases that invoke shell commands start from the top-level directory,
>> but this was not documented.
>
> Could you please also think if it is worth mentioning what happens when
> you do not even have a top-level directory?  I.e. in a bare repository.

Yes I thought about it.  I decided not to add that because
it is:

  - not common enough (how many new users fiddle in bare
    repos?)

  - not surprising enough (I did test it; it just uses the
    current -- bare -- directory, as even a new user would
    expect)

(In contrast, the part I added _was_ somewhat surprising.)

And if we go that far, why not also document what happens
with various combinations of $PWD,$GIT_DIR and
$GIT_WORK_TREE?  I did not get a chance to test those, but
if you think we should add those also, I will do so and
document what happens.

I just think it may be a bit overkill, but if you think it's
not, and it adds value, just say so and I will test and
document it.

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

* Re: [PATCH] Documentation: update description of shell aliases
  2009-07-02  0:57   ` Sitaram Chamarty
@ 2009-07-02  7:21     ` Andreas Ericsson
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Ericsson @ 2009-07-02  7:21 UTC (permalink / raw)
  To: Sitaram Chamarty; +Cc: Junio C Hamano, Git Mailing List

Sitaram Chamarty wrote:
> On Wed, Jul 1, 2009 at 11:51 PM, Junio C Hamano<gitster@pobox.com> wrote:
>> Sitaram Chamarty <sitaramc@gmail.com> writes:
>>
>>> Aliases that invoke shell commands start from the top-level directory,
>>> but this was not documented.
>> Could you please also think if it is worth mentioning what happens when
>> you do not even have a top-level directory?  I.e. in a bare repository.
> 
> Yes I thought about it.  I decided not to add that because
> it is:
> 
>   - not common enough (how many new users fiddle in bare
>     repos?)
> 

I do that quite a lot, but I can't recall ever using an alias
in a bare repo. It would be odd if I did, as the only alias I've
got is this:

   alias.wsfix=!git diff HEAD >P.diff && git reset --hard HEAD && git apply --whitespace=fix P.diff && rm -f P.diff

which isn't always doing the right thing even in a non-bare
repository, and never in a bare one.

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

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

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

end of thread, other threads:[~2009-07-02  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 16:00 [PATCH] Documentation: update description of shell aliases Sitaram Chamarty
2009-07-01 18:21 ` Junio C Hamano
2009-07-02  0:57   ` Sitaram Chamarty
2009-07-02  7:21     ` Andreas Ericsson

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