On Wed, Aug 7, 2013 at 2:57 PM, Stefan Tauner < stefan.tauner@student.tuwien.ac.at> wrote:
$ sh getrevision.sh -U fatal: ambiguous argument 'HEAD..->': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' getrevision.sh: line 115: [: -ge: unary operator expected getrevision.sh: line 115: [: 0: unary operator expected http://git.chromium.org/chromiumos/third_party/flashrom.git master
What about something like: git ls-remote --exit-code --get-url | sed 's/.*////'
That looks simpler and works better, at least in my testing...
The problem is the output of git branch -r --contains HEAD: origin/HEAD -> origin/master origin/master
Namely the origin/HEAD pointing to another branch which specifies the branch one checks out automatically when cloning the repository. I do not have this in my working repository where I was testing because i did add the chromium tree as a plain remote only...
I have attached another approach, now with: branches=$(git branch -r --contains HEAD | sed 's/[\t ]*//;/.*->.*/d')
That works nicely for my test cases. Anyone else?
Now to bikeshed the appearance of the the version string...