Re: [PATCH] git-svn.perl: Strip ChangeLog bits.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Nieuwenhuizen <janneke-list@xxxxxxxxx> wrote:
> On za, 2008-08-02 at 10:36 -0700, Junio C Hamano wrote:
> 
> > >   You forgot to document your option. (And possibly write a testcase.)
> > 
> > I am not sure if this is generic enough to be in git-svn.perl itself, or
> > perhaps there should be a hook make_log_entry() would call in the form of
> > some Perl scriptlet given by the user to munge $log_entry{log}, which
> > would be very specific to each project.
> 
> If you're not sure, please make up your mind.  I agree it's quite a hack
> but now it's in the archives for others to find.  Doing this in a single
> regexp is a bit tricky and asking a user to write a perl snippet is even
> worse, imho.  Especially if would turn out that stripping changelog bits
> is the only thing that the hook is getting used for, in the end.  I have
> gotten more careful to provide generic solutions to specific problems in
> anticipation of possible future desires.
> 
> I could imagine that leaving git-svn alone and adding a hook to git-log
> would be more useful, though.

NACK on modifying git-svn to support more changelog formats.

A better idea would be to write a generic script that takes "git log",
"git svn log" or even plain "svn log" output and filters it
independently.

This way existing projects don't have to be re-imported (a bad idea to
modify things SVN feeds us anyways), and plain svn users can benefit,
too.

This filter should be reusable for both plain svn and git-svn:

    svn log | changelog-filter --input=svn --style=gnu
    git svn log | changelog-filter --input=svn --style=gnu
    git log --pretty=raw | changelog-filter --input=git-raw --style=gnu


However, I would support a generic --log-filter parameter in git-svn
that would have git-svn filter its output through any given command
before piping it to less.

    git config svn.logFilter "changelog-filter --input=svn --style=gnu"
    git svn log
      or...
    git svn log --log-filter="changelog-filter --input=svn --style=yak"
    git svn log --log-filter="svn-log-to-LaTeX"
    git svn log --log-filter="svn-log-to-HTML"
    git svn log --log-filter="svn-log-to-XML"
    git svn log --log-filter="svn-log-to-JSON"
    git svn log --log-filter="svn-log-to-PNG" > log.png
    git svn log --log-filter="svn-log-to-theora" > log.ogg

    The possibilities are endless :)

-- 
Eric Wong
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux