Re: git-describe considers WC dirty incorrectly when using --git-dir

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

 



Chris Pimlott <chris@xxxxxxxxxxx> writes:

> It seems that git-describe always thinks that working copy is dirty if
> you are not in the WC root and you explicitly specify the .git
> directory location using --git-dir:
>
>   # set up test repo
>   folio:~ chris$ mkdir repo && cd repo
>   folio:repo chris$ mkdir text && echo hi > text/hi.txt
>   folio:repo chris$ git init . && git add . && git commit -m "text/hi.txt"
>   Initialized empty Git repository in /home/chris/repo/.git/
>   [master (root-commit) c0edd63] text/hi.txt
>   1 file changed, 1 insertion(+)
>   create mode 100644 text/hi.txt
>
>   # git-describe from non-root directory
>   folio:repo chris$ cd text
>   folio:text chris$ git describe --always --dirty
>   c0edd63
>   folio:text chris$ git --git-dir=../.git describe --always --dirty
>   c0edd63-dirty
>   folio:text chris$ git --git-dir=$(git rev-parse
> --show-toplevel)/.git describe --always --dirty
>   c0edd63-dirty

I have a feeling that this is not limited to describe at all.  With
the --git-dir option, you are telling Git that your GIT_DIR is over
there and (by not using --work-tree together with that option) you
are telling Git that you do not want Git to guess where the working
tree is (instead, you are telling Git that you are at the top of the
working tree), no?


--
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]