Re: Shell aliases & paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May  4, Jonathan Nieder wrote:
> Eli Barzilay wrote:
> 
> > AFAICT, a shell command alias (one that starts with a "!") is
> > executed from the repository root, but to make things worse it
> > looks like there is no way to tell which directory it was executed
> > from.  If this is correct, then these aliases are useless for
> > anything that need to accept relative paths.  Is there something
> > obvious that I'm missing?
> 
> Not that I can see.  Maybe a new GIT_PATHNAME_PREFIX environment
> variable would help.

Yeah, I was searching the environment for something like that, and was
surprised when I didn't find any shred of the original path in there.
(In any case, I'd like to see something like that, although it's too
late for me to use it since I need a solution that works now...)


> If we were starting from scratch, it might be nice to make aliases
> suppress the chdir to toplevel.  Unfortunately, that would probably
> break some existing aliases.  Another possibility would be to use
> some alternative convention (like [alias] foo = "# bar") to suppress
> the repository search.



> At that point, why not just add a git-foo script to $PATH?  (‘git
> foo’ will still call it.)

The same can be said on all shell aliases, no?

FWIW, I find these aliases more convenient in having "extensions" work
for other people -- ie, it's easier to say "here's some text, dump it
in your ~/.gitconfig" than it is to explain where some script should
be added and how ("put the text in a git-foo file, make sure to chmod
+x it, put that in your $PATH, you do have your own bin directory,
right?").

(But the disclaimer here is that I have a very narrow point of view.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]