Re: [PATCH] rev-parse: Fix shell scripts whose cwd is a symlink into a git work-dir

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

 



Jakub Narebski wrote:
"Marcel M. Cary" <marcel@xxxxxxxxxxxxxxxx> writes:

* Change "git rev-parse --show-cdup" to print a full path instead of
  a series of "../" when it prints anything

But that is contrary to the _name_ of option. It is --show-cdup, as
in "show cd up". And I think your change will break a few scripts.

I think you should use "git rev-parse --work-tree" for full path
to working directory:

    --show-cdup
        When the command is invoked from a subdirectory, show the path
        of the top-level directory relative to the current directory
        (typically a sequence of "../", or an empty string).


AFAIR, it was introduced to make test-builds of really large projects in
really deep directories with a ton of symlinks leading to the path work a
lot faster.

The thing to remember about git and its UI is that it was evolved from
users' actual needs. Very, very little of what is in the UI can be reworked
without breaking something for someone, so it's (almost) always better to
add a new option. For this, I'd suggest "--show-absolute-worktree-path" if
that's what it does. Since it's an option primarily targeting scripts, I'm
not too worried that it's half a mile long.

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
--
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]

  Powered by Linux