Simulating an empty git repository without having said repository on disk
- From
Richard Hartmann <richih.mailinglist@gmail.com>
- Date
- Jan 16, 2012, 18:34 UTC
- Message-ID
- <CAD77+gR=txp8sKrA57ztQX0a1-QZM7wwR6ThBq77c=c+AbsS0w@mail.gmail.com>
Hi all,
for vcsh[1], I need a rather hackish feature: List all files untracked by vcsh. The plan to achieve this is:
Get lists of all files by all repos which' GIT_WORK_TREE is in one directory ($HOME, by default), merge all lists into one and use that as a .gitignore or exclude. Then run `git status` with $GIT_WORK_TREE pointing to $HOME while using said ignore/exclude. That will give me a list of all files & directories which are not tracked by any of the git repos managed by vcsh.
I could create an empty git repo to run this operation in, but that seems wasteful. Thus, I would prefer to run this command against a non-existing, empty git repo. Problem is, I could not find a way to do this.
I know the empty tree's SHA is hard-coded into git so I was hoping there would be a way to trick git using this, but I couldn't find a way.
Any and all help appreciated, even if it's just a "no, this is not possible"
Thanks, Richard
[1] https://github.com/RichiH/vcsh