Python script for automatic synchronization based on inotify

René Mayrhofer rene at mayrhofer.eu.org
Wed Mar 23 11:28:14 CET 2011


Am Mittwoch, 23. März 2011, um 09:33:37 schrieb Dieter Plaetinck:
> On Wed, 23 Mar 2011 08:00:27 +0100
> martin f krafft <madduck at madduck.net> wrote:
> 
> > also sprach Dieter Plaetinck <dieter at plaetinck.be> [2011.03.20.1235
> > +0100]:
> > > oh, one more thing.
> > > you can query the current branch in a pure-python way, by
> > > reading .git/HEAD
> > 
> > No, please do not use this. Use
> > 
> >   git symbolic-ref -q HEAD || git name-rev --name-only HEAD
> > 
> 
> well, the idea behind doing it in pure-python is removing the overhead
> of spawning extra processes, do you have an argument why reading the
> branchname of the current HEAD in a few lines of python is bad?

I agree with Martin that parsing git internals does not seem the right way to do it - they might change at some point. Additionally, I'd like to keep dvcs-autosync as agnostic to the used DVCS as possible (otherwise it will quickly become a git-autosync). At the moment, the DVCS can be swapped out by changing only the config file options. If I can keep that without sacrificing too much performance, I'd like to do so.

best regards,
Rene
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.madduck.net/pipermail/vcs-home/attachments/20110323/218ce0e8/attachment.pgp>


More information about the vcs-home mailing list