[petsc-dev] get rid of https://bitbucket.org/petsc/petsc-dev NOW

Jed Brown jed at jedbrown.org
Thu Sep 4 22:58:32 CDT 2014


Satish Balay <balay at mcs.anl.gov> writes:
>> What's wrong with "git rev-parse --abbrev-ref HEAD" or "git symbolic-ref HEAD"?
>
> balay at asterix /home/balay/petsc (maint)
> $ git checkout origin/master
>
> <snip>
>
> balay at asterix /home/balay/petsc ((de1529e...))
> $ git branch | sed -n '/\* /s///p'
> (detached from origin/master)
> balay at asterix /home/balay/petsc ((de1529e...))
> $ git rev-parse --abbrev-ref HEAD
> HEAD

Yeah, less useful.

> balay at asterix /home/balay/petsc ((de1529e...))
> $ git symbolic-ref HEAD
> fatal: ref HEAD is not a symbolic ref

Maybe

  git symbolic-ref -q HEAD || git rev-parse HEAD

or

  git describe --all --contains HEAD

> balay at asterix /home/balay/petsc ((de1529e...))
>
> Notice the first one has useful info - but not the others. Even
> git-prompt gives some useful info [if not the the branch name..]
>
> So I pushed a change using 'git branch' and parsing its output
> from python [instead of 'sed']
>
> I'm suprised 'git branch' doesnt do the most obvious thing that one
> would expect. [default to - or have an option to list the current
> branch - not all the branches]

Perhaps, but it wouldn't fix the problem because there isn't always a
"current branch".  I would rather script with plumbing commands instead
of ones that could change output format.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140904/028d581d/attachment.sig>


More information about the petsc-dev mailing list