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

Re: How to contribute VCSInfo back end for fossil



On Fri, 18 Mar 2011 00:06:26 +0100
Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:

> Mike Meyer wrote:
> > Sorry if this is the wrong place, but neither google nor
> > hand-examining the zsh sites turned up a place for such submissions...
> This is exactly the right place.

Cool.

> As you can see, I've removed the code that surrounded the `$fsrev'
> variable. Specifically, the `fsrevformat' style and the
> `set-fsrev-format' hook. They didn't add much, as you've got full access
> to the same data in with the `branchformat' style and the
> `set-branch-format' hook (I kept the `$fsrev' variable for clarity).

That was modeled after the hgrevformat variable. If that's gone away
in later versions, then fsrevformat should go away.

I initially did this without fsrevformat. I changed it because it
seems slightly cleaner to have vcs-specific variables that control how
the revision value is presented for each vcs rather than having to
tweak branchformat for each vcs with a hash-based revision - which
seems to be required because once you shorten it, zformat can't make
it longer, so that %r has to be the entire hash, which is unwieldy.
With fsrevformat, I only have to change branchformat and the various
VCS's follow automatically, rather than having to change branchformat
for each VCS using hash-based revisions. Maybe the hook facility
solves this - I haven't really explored that.

Either way is fine with me. I just wanted to present the reason before
committing to the other way.

> Like this, the only required documentation update would be to name
> fossil among the supported systems in zshcontrib(1).
> 
> If you're okay with those changes, it would be good if you could check
> whether the above code works or not - I didn't test those changes.

They don't work. You deleted the setting of hook_com prior to setting
fsrev, which meant fsrev was set to "".  It needs to be set to
${fshash}. I think the fshash name is better, as it is the hash
string. If you want it without fsrevformat, I'll wind up pushing that
to the repo in any case, but let me know if you'd rather I email you
that version.

While I'm here - it seems that the git backend doesn't pay attention
to branchformat. Is that a bug (possibly fixed later) or intentional?

      Thanks,
      <mike
-- 
Mike Meyer <mwm@xxxxxxxxx>		http://www.mired.org/consulting.html
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



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