Re: git gc seems to break --symbolic-full-name

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

 



21.07.2017 21:56, Junio C Hamano пишет:
Stas Sergeev <stsp@xxxxxxx> writes:

I do the following:

$ git rev-parse --symbolic-full-name devel
refs/heads/devel
$ ls -l .git/`git rev-parse --symbolic-full-name devel`
-rw-rw-r-- 1 stas stas 41 июл 21 15:05 .git/refs/heads/devel

This is fine. But after git gc:

$ git rev-parse --symbolic-full-name devel
refs/heads/devel
$ LC_ALL=C ls -l .git/`git rev-parse --symbolic-full-name devel`
ls: cannot access '.git/refs/heads/devel': No such file or directory
This is expected, and in the modern world (like, after year 2007),
a refname "refs/heads/foo" does *not* mean that there is a file
with such a path under .git/ directory.  "rev-parse" does not return
any "path" in the filesystem sense.

See "git pack-refs --help", and depending on what you want to learn
about the ref in question, perhaps "git show-ref refs/heads/devel"
is what you want.
I wanted some kind of file to use it as a
build dependency for the files that needs
to be re-built when the head changes.
This works very well besides git gc.
What other method can be used as simply
as that? git show-ref does not seem to be
giving this.



[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