Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH 2/2] vcs_info git: For the branch name, try to find a symbolic name before falling back to a raw commit hex.



Frank Terbeck wrote on Sat, 18 Aug 2018 22:41 +0200:
> Daniel Shahaf wrote:
> > Ask git-describe(1) and git-name-rev(1) to compute a gitrevisions(1)
> > name in terms of a branch or tag that contains (= is a descendant of,
> > is younger than) HEAD.
> >
> > In this repository, the output changes from "9567bfe..." to
> > "master~1" or "remotes/origin/HEAD~1".
> > ---
> > WDYT?
> 
> I like it. Maybe use a style to make it possible to get the old
> behavior back, if someone prefers it?

Thanks for the review.  Two thoughts about this:

1. Adding knobs induces a maintenance cost going forward.  Is that cost
   justified in this case?  We can always add the knob later if there's
   demand for it, but it's harder to take away behaviour once it has
   been released.

2. At what point in the if-chain do we raise the white flag^W^W^W^W
   check the "early exit?" style?

I suppose we could overload the `use-simple` style for this purpose (the
git backend doesn't currently use that style).  The `get-revision` style
is also relevant.

Cheers,

Daniel

P.S. This also kicks in during bisects, resulting in values such as "bisect/bad~20".



Messages sorted by: Reverse Date, Date, Thread, Author