{"thread":{"id":"12273","subject":"[PATCH] Documentation/git-filter-branch: add a new commit-filter example","startedAt":"2008-02-23T19:30:58Z","lastAt":"2008-02-25T14:43:53Z","messageCount":6,"participants":["Miklos Vajna","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"69699","messageId":"20080223193058.GE31441@genesis.frugalware.org","threadId":"12273","inReplyTo":null,"subject":"[PATCH] Documentation/git-filter-branch: add a new commit-filter example","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-02-23T19:30:58Z","receivedAt":"2008-02-23T19:30:58Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"There is a commit-filter example already which skips commits but there is no\nexample on how to edit commit messages.\n\nOne can figure out this example by carefully reading the git-filter-branch and\ngit-commit-tree documentation but I think it isn't trivial so this example is\nhelpful.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nThe lack of such an example was noticed by dvorak on IRC.\n\n Documentation/git-filter-branch.txt |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex e22dfa5..a035b9c 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -240,6 +240,12 @@ committed a merge between P1 and P2, it will be propagated properly\n and all children of the merge will become merge commits with P1,P2\n as their parents instead of the merge commit.\n \n+To remove the 'git-svn-id' strings from commit messages in a repository created\n+by git-svn:\n+\n+------------------------------------------------------------------------------\n+git filter-branch --commit-filter 'sed \"/^git-svn-id:/d\" |git commit-tree \"$@\"'\n+------------------------------------------------------------------------------\n \n To restrict rewriting to only part of the history, specify a revision\n range in addition to the new branch name.  The new branch name will\n-- \n1.5.4.2\n"},{"id":"69702","messageId":"7vejb3319j.fsf@gitster.siamese.dyndns.org","threadId":"12273","inReplyTo":"20080223193058.GE31441@genesis.frugalware.org","subject":"Re: [PATCH] Documentation/git-filter-branch: add a new commit-filter example","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-23T19:45:28Z","receivedAt":"2008-02-23T19:45:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Miklos Vajna <vmiklos@frugalware.org> writes:\n\n> There is a commit-filter example already which skips commits but there is no\n> example on how to edit commit messages.\n>\n> One can figure out this example by carefully reading the git-filter-branch and\n> git-commit-tree documentation but I think it isn't trivial so this example is\n> helpful.\n>\n> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n> ---\n>\n> The lack of such an example was noticed by dvorak on IRC.\n>\n>  Documentation/git-filter-branch.txt |    6 ++++++\n>  1 files changed, 6 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\n> index e22dfa5..a035b9c 100644\n> --- a/Documentation/git-filter-branch.txt\n> +++ b/Documentation/git-filter-branch.txt\n> @@ -240,6 +240,12 @@ committed a merge between P1 and P2, it will be propagated properly\n>  and all children of the merge will become merge commits with P1,P2\n>  as their parents instead of the merge commit.\n>  \n> +To remove the 'git-svn-id' strings from commit messages in a repository created\n> +by git-svn:\n\nPeople who are not interested in git-svn at all may still want\nto fix up their commit log messages, and I think starting a\nparagraph with 'git-svn-blah' would risk them skipping it\nwithout reading (I certainly would).  Probably we would want to\nadd a sentence before \"To remove ...\", like this:\n\n\tYou can rewrite the commit log messages using `--commit-filter`.\n\tFor example, `git-svn-id` strings in a repository created with\n\t`git-svn` can be cleaned up this way:\n\n> +------------------------------------------------------------------------------\n> +git filter-branch --commit-filter 'sed \"/^git-svn-id:/d\" |git commit-tree \"$@\"'\n> +------------------------------------------------------------------------------\n\nPlease try to keep them a bit shorter for reviewing pleasure on\n80-column terminals after your message was quoted once or\nperhaps a few times.  The example is easier to read if you write\nlike this, I think:\n\n----------------------------------------------------------------\ngit filter-branch --commit-filter '\n\tsed -e \"/^git-svn-id:/d\" | git commit-tree \"$@\"\n'\n----------------------------------------------------------------\n\nI am not sure if git-svn people condone or encourage such\nremovals, though.\n"},{"id":"69719","messageId":"20080223220433.GG31441@genesis.frugalware.org","threadId":"12273","inReplyTo":"7vejb3319j.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Documentation/git-filter-branch: add a new commit-filter example","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-02-23T22:04:33Z","receivedAt":"2008-02-23T22:04:33Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"There is a commit-filter example already which skips commits but there is no\nexample on how to edit commit messages.\n\nOne can figure out this example by carefully reading the git-filter-branch and\ngit-commit-tree documentation but I think it isn't trivial so this example is\nhelpful.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Sat, Feb 23, 2008 at 11:45:28AM -0800, Junio C Hamano\n<gitster@pobox.com> wrote:\n> People who are not interested in git-svn at all may still want\n> to fix up their commit log messages, and I think starting a\n> paragraph with 'git-svn-blah' would risk them skipping it\n> without reading (I certainly would).  Probably we would want to\n> add a sentence before \"To remove ...\", like this:\n>\n>       You can rewrite the commit log messages using `--commit-filter`.\n>       For example, `git-svn-id` strings in a repository created with\n>       `git-svn` can be cleaned up this way:\n\nsecond try follows :)\n\n>\n> > +------------------------------------------------------------------------------\n> > +git filter-branch --commit-filter 'sed \"/^git-svn-id:/d\" |git\n> > commit-tree \"$@\"'\n> > +------------------------------------------------------------------------------\n>\n> Please try to keep them a bit shorter for reviewing pleasure on\n> 80-column terminals after your message was quoted once or\n> perhaps a few times.  The example is easier to read if you write\n> like this, I think:\n>\n> ----------------------------------------------------------------\n> git filter-branch --commit-filter '\n>       sed -e \"/^git-svn-id:/d\" | git commit-tree \"$@\"\n> '\n> ----------------------------------------------------------------\n>\n\nok. i used 72 in my mails and 80 in the code, but now i'm using 72 in\nthe code as well.\n\n> I am not sure if git-svn people condone or encourage such\n> removals, though.\n\ni think it's only useful if you use git-svn for an svn -> git\nconversion, provided that the project switches to git (there will be no\nmore svn commits and noone wants to push back git commits to svn).\n\n Documentation/git-filter-branch.txt |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex e22dfa5..367064b 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -240,6 +240,15 @@ committed a merge between P1 and P2, it will be propagated properly\n and all children of the merge will become merge commits with P1,P2\n as their parents instead of the merge commit.\n \n+You can rewrite the commit log messages using `--commit-filter`.  For\n+example, `git-svn-id` strings in a repository created by `git-svn` can\n+be removed this way:\n+\n+-------------------------------------------------------\n+git filter-branch --commit-filter '\n+\tsed -e \"/^git-svn-id:/d\" | git commit-tree \"$@\"\n+'\n+-------------------------------------------------------\n \n To restrict rewriting to only part of the history, specify a revision\n range in addition to the new branch name.  The new branch name will\n-- \n1.5.4.2\n"},{"id":"69780","messageId":"alpine.DEB.1.00.0802241151390.6881@eeepc-johanness","threadId":"12273","inReplyTo":"20080223220433.GG31441@genesis.frugalware.org","subject":"Re: [PATCH] Documentation/git-filter-branch: add a new commit-filter example","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-24T10:53:34Z","receivedAt":"2008-02-24T10:53:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 23 Feb 2008, Miklos Vajna wrote:\n\n> +-------------------------------------------------------\n> +git filter-branch --commit-filter '\n> +\tsed -e \"/^git-svn-id:/d\" | git commit-tree \"$@\"\n> +'\n> +-------------------------------------------------------\n\nAnd there I thought that was the job of --msg-filter ;-)\n\nCiao,\nDscho\n"},{"id":"69804","messageId":"7v7iguxmlq.fsf@gitster.siamese.dyndns.org","threadId":"12273","inReplyTo":"alpine.DEB.1.00.0802241151390.6881@eeepc-johanness","subject":"Re: [PATCH] Documentation/git-filter-branch: add a new commit-filter example","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-24T17:58:41Z","receivedAt":"2008-02-24T17:58:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Sat, 23 Feb 2008, Miklos Vajna wrote:\n>\n>> +-------------------------------------------------------\n>> +git filter-branch --commit-filter '\n>> +\tsed -e \"/^git-svn-id:/d\" | git commit-tree \"$@\"\n>> +'\n>> +-------------------------------------------------------\n>\n> And there I thought that was the job of --msg-filter ;-)\n\nAhhhhhhh, that was the little voice that kept telling me there\nis something wrong with the patch...\n"},{"id":"69888","messageId":"20080225144353.GT31441@genesis.frugalware.org","threadId":"12273","inReplyTo":"7v7iguxmlq.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Documentation/git-filter-branch: add a new msg-filter example","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-02-25T14:43:53Z","receivedAt":"2008-02-25T14:43:53Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"There were no example on how to edit commit messages, so add an msg-filter\nexample.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Sun, Feb 24, 2008 at 09:58:41AM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> Ahhhhhhh, that was the little voice that kept telling me there\n> is something wrong with the patch...\n\nuh-oh. third try :)\n\n Documentation/git-filter-branch.txt |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex e22dfa5..1948f6f 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -240,6 +240,15 @@ committed a merge between P1 and P2, it will be propagated properly\n and all children of the merge will become merge commits with P1,P2\n as their parents instead of the merge commit.\n \n+You can rewrite the commit log messages using `--message-filter`.  For\n+example, `git-svn-id` strings in a repository created by `git-svn` can\n+be removed this way:\n+\n+-------------------------------------------------------\n+git filter-branch --message-filter '\n+\tsed -e \"/^git-svn-id:/d\"\n+'\n+-------------------------------------------------------\n \n To restrict rewriting to only part of the history, specify a revision\n range in addition to the new branch name.  The new branch name will\n-- \n1.5.4.3\n"}]}