git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
EWEric Wong <normalperson@yhbt.net>
Date
Aug 4, 2008, 02:09 UTC
Message-ID
<20080804020931.GA4109@untitled>
In-Reply-To
<1217701021.8296.35.camel@heerbeest>
Jan Nieuwenhuizen <janneke-list@xs4all.nl> wrote:
Show 19 quoted lines
> 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
Previous: Jan NieuwenhuizenNext: Junio C Hamano
Message 9 of 14 in “git-svn.perl: Strip ChangeLog bits.”
  1. git-svn.perl: Strip ChangeLog bits.Jan Nieuwenhuizen, Aug 2, 2008
  2. Petr BaudisAug 2, 2008
  3. Junio C HamanoAug 2, 2008
  4. Jan NieuwenhuizenAug 2, 2008
  5. Junio C HamanoAug 2, 2008
  6. Jan NieuwenhuizenAug 3, 2008
  7. Junio C HamanoAug 3, 2008
  8. Jan NieuwenhuizenAug 4, 2008
  9. Eric WongAug 4, 2008
  10. Junio C HamanoAug 4, 2008
  11. Jan NieuwenhuizenAug 4, 2008
  12. Eric WongAug 4, 2008
  13. Jan NieuwenhuizenAug 4, 2008
  14. Jan NieuwenhuizenAug 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.