{"thread":{"id":"9708","subject":"[PATCH] git-filter-branch: more detailed USAGE","startedAt":"2007-08-30T15:56:07Z","lastAt":"2007-08-31T06:16:39Z","messageCount":12,"participants":["Giuseppe Bilotta","Johannes Sixt","Junio C Hamano","David Kastrup","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"51920","messageId":"11884893671845-git-send-email-giuseppe.bilotta@gmail.com","threadId":"9708","inReplyTo":null,"subject":"[PATCH] git-filter-branch: more detailed USAGE","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2007-08-30T15:56:07Z","receivedAt":"2007-08-30T15:56:07Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n---\n git-filter-branch.sh |   11 ++++++++++-\n 1 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 0190060..9fcab56 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -8,7 +8,16 @@\n # a new branch. You can specify a number of filters to modify the commits,\n # files and trees.\n \n-USAGE=\"git-filter-branch [-d TEMPDIR] [FILTERS] [REV-RANGE]\"\n+USAGE=\"[-d <tempdir>] \\\n+[--env-filter <command>] \\\n+[--tree-filter <command>] \\\n+[--index-filter <command>] \\\n+[--parent-filter <command>] \\\n+[--msg-filter <command>] \\\n+[--commit-filter <command>] \\\n+[--tag-name-filter <command>] \\\n+[--subdirectory-filter <command>] \\\n+[--original <namespace>] [rev-range]\"\n . git-sh-setup\n \n warn () {\n-- \n1.5.2.5\n"},{"id":"51923","messageId":"46D6EE65.3040503@telecom.at","threadId":"9708","inReplyTo":"11884893671845-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH] git-filter-branch: more detailed USAGE","fromName":"Johannes Sixt","fromEmail":"j.sixt@telecom.at","sentAt":"2007-08-30T16:20:53Z","receivedAt":"2007-08-30T16:20:53Z","isPatch":true,"sender":{"key":"j.sixt@telecom.at","avatar":null},"body":"Giuseppe Bilotta schrieb:\n> -USAGE=\"git-filter-branch [-d TEMPDIR] [FILTERS] [REV-RANGE]\"\n> +USAGE=\"[-d <tempdir>] \\\n> +[--env-filter <command>] \\\n> +[--tree-filter <command>] \\\n> +[--index-filter <command>] \\\n> +[--parent-filter <command>] \\\n> +[--msg-filter <command>] \\\n> +[--commit-filter <command>] \\\n> +[--tag-name-filter <command>] \\\n> +[--subdirectory-filter <command>] \\\n\n+[--subdirectory-filter <directory>] \\\n\n> +[--original <namespace>] [rev-range]\"\n\n-- Hannes\n"},{"id":"51926","messageId":"1188493842963-git-send-email-giuseppe.bilotta@gmail.com","threadId":"9708","inReplyTo":"11884893671845-git-send-email-giuseppe.bilotta@gmail.com","subject":"[PATCH] git-filter-branch: more detailed USAGE","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2007-08-30T17:10:41Z","receivedAt":"2007-08-30T17:10:41Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n---\n git-filter-branch.sh |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 0190060..ec2f75d 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -8,7 +8,13 @@\n # a new branch. You can specify a number of filters to modify the commits,\n # files and trees.\n \n-USAGE=\"git-filter-branch [-d TEMPDIR] [FILTERS] [REV-RANGE]\"\n+USAGE=\"[--env-filter <command>] [--tree-filter <command>] \\\n+[--index-filter <command>] [--parent-filter <command>] \\\n+[--msg-filter <command>] [--commit-filter <command>] \\\n+[--tag-name-filter <command>] [--subdirectory-filter <directory>] \\\n+[--original <namespace>] [-d <directory>] [-f | --force] \\\n+[<rev-list options>...]\"\n+\n . git-sh-setup\n \n warn () {\n-- \n1.5.2.5\n"},{"id":"51927","messageId":"11884938431525-git-send-email-giuseppe.bilotta@gmail.com","threadId":"9708","inReplyTo":"1188493842963-git-send-email-giuseppe.bilotta@gmail.com","subject":"[PATCH] git-filter-branch: document --original option","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2007-08-30T17:10:42Z","receivedAt":"2007-08-30T17:10:42Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n---\n Documentation/git-filter-branch.txt |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex 8c43be6..ae03514 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -12,7 +12,8 @@ SYNOPSIS\n \t[--index-filter <command>] [--parent-filter <command>]\n \t[--msg-filter <command>] [--commit-filter <command>]\n \t[--tag-name-filter <command>] [--subdirectory-filter <directory>]\n-\t[-d <directory>] [-f | --force] [<rev-list options>...]\n+\t[--original <namespace>] [-d <directory>] [-f | --force]\n+\t[<rev-list options>...]\n \n DESCRIPTION\n -----------\n@@ -134,6 +135,10 @@ definition impossible to preserve signatures at any rate.)\n \tThe result will contain that directory (and only that) as its\n \tproject root.\n \n+--original <namespace>::\n+\tUse this option to set the namespace where the original commits\n+\twill be stored. The default value is 'refs/original'.\n+\n -d <directory>::\n \tUse this option to set the path to the temporary directory used for\n \trewriting.  When applying a tree filter, the command needs to\n-- \n1.5.2.5\n"},{"id":"51925","messageId":"cb7bb73a0708301011s3aa3dffaxa75d8fcee320d143@mail.gmail.com","threadId":"9708","inReplyTo":"46D6EE65.3040503@telecom.at","subject":"Re: [PATCH] git-filter-branch: more detailed USAGE","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2007-08-30T17:11:11Z","receivedAt":"2007-08-30T17:11:11Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"On 8/30/07, Johannes Sixt <j.sixt@telecom.at> wrote:\n> Giuseppe Bilotta schrieb:\n> > +[--subdirectory-filter <command>] \\\n>\n> +[--subdirectory-filter <directory>] \\\n\nDoh. I'll resend.\n\n-- \nGiuseppe \"Oblomov\" Bilotta\n"},{"id":"51949","messageId":"7vy7fs7kmc.fsf@gitster.siamese.dyndns.org","threadId":"9708","inReplyTo":"11884938431525-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH] git-filter-branch: document --original option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-30T21:55:39Z","receivedAt":"2007-08-30T21:55:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:\n\n> +--original <namespace>::\n> +\tUse this option to set the namespace where the original commits\n> +\twill be stored. The default value is 'refs/original'.\n> +\n\nThe default seems to be \"refs/original/\".\n\nEven worse.\n\nI think if you say --force --original refs/head (notice the lack\nof \"s\" nor slash at the end), the code will get you in a *lot*\nof trouble.\n\nDscho, don't we want to do something like this?\n\n---\n git-filter-branch.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 0190060..a7f50a6 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -134,6 +134,7 @@ do\n \t\tfilter_subdir=\"$OPTARG\"\n \t\t;;\n \t--original)\n+\t\tcase \"$OPTARG\" in */) ;; *) OPTARG=\"$OPTARG/\" ;; esac\n \t\torig_namespace=\"$OPTARG\"\n \t\t;;\n \t*)\n"},{"id":"51950","messageId":"85d4x4d6oi.fsf@lola.goethe.zz","threadId":"9708","inReplyTo":"7vy7fs7kmc.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-filter-branch: document --original option","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-30T22:00:13Z","receivedAt":"2007-08-30T22:00:13Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:\n>\n>> +--original <namespace>::\n>> +\tUse this option to set the namespace where the original commits\n>> +\twill be stored. The default value is 'refs/original'.\n>> +\n>\n> The default seems to be \"refs/original/\".\n>\n> Even worse.\n>\n> I think if you say --force --original refs/head (notice the lack\n> of \"s\" nor slash at the end), the code will get you in a *lot*\n> of trouble.\n>\n> Dscho, don't we want to do something like this?\n>\n> ---\n>  git-filter-branch.sh |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-filter-branch.sh b/git-filter-branch.sh\n> index 0190060..a7f50a6 100755\n> --- a/git-filter-branch.sh\n> +++ b/git-filter-branch.sh\n> @@ -134,6 +134,7 @@ do\n>  \t\tfilter_subdir=\"$OPTARG\"\n>  \t\t;;\n>  \t--original)\n> +\t\tcase \"$OPTARG\" in */) ;; *) OPTARG=\"$OPTARG/\" ;; esac\n>  \t\torig_namespace=\"$OPTARG\"\n>  \t\t;;\n>  \t*)\n\norig_namespace=\"${OPTARG%/}/\"\n\nSure, it does not win the \"portable to Version 7\" price, but our\nscripts don't do that, anyway.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"51952","messageId":"7vodgo7jbn.fsf@gitster.siamese.dyndns.org","threadId":"9708","inReplyTo":"85d4x4d6oi.fsf@lola.goethe.zz","subject":"Re: [PATCH] git-filter-branch: document --original option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-30T22:23:40Z","receivedAt":"2007-08-30T22:23:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Kastrup <dak@gnu.org> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> ...\n>>  \t--original)\n>> +\t\tcase \"$OPTARG\" in */) ;; *) OPTARG=\"$OPTARG/\" ;; esac\n>>  \t\torig_namespace=\"$OPTARG\"\n>>  \t\t;;\n>>  \t*)\n>\n> orig_namespace=\"${OPTARG%/}/\"\n>\n> Sure, it does not win the \"portable to Version 7\" price, but our\n> scripts don't do that, anyway.\n\nI agree we do not give the \"portable to version 7\" prize\nanymore.  But you made me realize another thing.\n\nI think it should make sure orig_namespace has one and only one\ntrailing slash, because otherwise \"--original refs/heads//\"\nwould lead you to the same disaster.\n"},{"id":"51958","messageId":"Pine.LNX.4.64.0708310004130.28586@racer.site","threadId":"9708","inReplyTo":"7vy7fs7kmc.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-filter-branch: document --original option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-30T23:04:52Z","receivedAt":"2007-08-30T23:04:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 30 Aug 2007, Junio C Hamano wrote:\n\n> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:\n> \n> > +--original <namespace>::\n> > +\tUse this option to set the namespace where the original commits\n> > +\twill be stored. The default value is 'refs/original'.\n> > +\n> \n> The default seems to be \"refs/original/\".\n> \n> Even worse.\n> \n> I think if you say --force --original refs/head (notice the lack\n> of \"s\" nor slash at the end), the code will get you in a *lot*\n> of trouble.\n> \n> Dscho, don't we want to do something like this?\n\nYes, I think so, too.  The --original option is probably the least tested \noption of filter-branch :-(\n\nCiao,\nDscho\n"},{"id":"51961","messageId":"7v3ay07h0h.fsf@gitster.siamese.dyndns.org","threadId":"9708","inReplyTo":"7vodgo7jbn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-filter-branch: document --original option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-30T23:13:34Z","receivedAt":"2007-08-30T23:13:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I agree we do not give the \"portable to version 7\" prize\n> anymore.  But you made me realize another thing.\n>\n> I think it should make sure orig_namespace has one and only one\n> trailing slash, because otherwise \"--original refs/heads//\"\n> would lead you to the same disaster.\n\nPerhaps,\n\n\torig_namespace=$(expr \"$OPTARG/\" : '\\(.*[^/]\\)/*$')/\n\nWell, I know people hate colon-expr, but we earlier ruled out\n(and we still do) ${parameter//pattern/string} as bashism beyond\nthe portability line, and I do not see an alternative easier to\nread than this...\n"},{"id":"51991","messageId":"85642wcju7.fsf@lola.goethe.zz","threadId":"9708","inReplyTo":"7vodgo7jbn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-filter-branch: document --original option","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-31T06:13:36Z","receivedAt":"2007-08-31T06:13:36Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> David Kastrup <dak@gnu.org> writes:\n>\n>> Junio C Hamano <gitster@pobox.com> writes:\n>> ...\n>>>  \t--original)\n>>> +\t\tcase \"$OPTARG\" in */) ;; *) OPTARG=\"$OPTARG/\" ;; esac\n>>>  \t\torig_namespace=\"$OPTARG\"\n>>>  \t\t;;\n>>>  \t*)\n>>\n>> orig_namespace=\"${OPTARG%/}/\"\n>>\n>> Sure, it does not win the \"portable to Version 7\" price, but our\n>> scripts don't do that, anyway.\n>\n> I agree we do not give the \"portable to version 7\" prize\n> anymore.  But you made me realize another thing.\n>\n> I think it should make sure orig_namespace has one and only one\n> trailing slash, because otherwise \"--original refs/heads//\"\n> would lead you to the same disaster.\n\nI am not sure we should bend over backwards to people courting\ndisaster.  Completion does not add double slashes, and that's the most\ncommon cause for spurious slashes.  And I don't know an equally\nstraightforward way to remove multiple slashes at the end.\n\ndo orig_namespace=\"$OPTARG\";OPTARG=\"${OPTARG%/}/\"\nwhile test \"X${orig_namespace}\" != \"X${OPTARG}\"\n\nis not really all too pretty.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"51992","messageId":"851wdkcjp4.fsf@lola.goethe.zz","threadId":"9708","inReplyTo":"7v3ay07h0h.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-filter-branch: document --original option","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-31T06:16:39Z","receivedAt":"2007-08-31T06:16:39Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> I agree we do not give the \"portable to version 7\" prize\n>> anymore.  But you made me realize another thing.\n>>\n>> I think it should make sure orig_namespace has one and only one\n>> trailing slash, because otherwise \"--original refs/heads//\"\n>> would lead you to the same disaster.\n>\n> Perhaps,\n>\n> \torig_namespace=$(expr \"$OPTARG/\" : '\\(.*[^/]\\)/*$')/\n>\n\nSee separate proposal which I find still prettier (and which does not\nfork).\n\nBut I really don't think we should bend over backwards: multiple end\nslashes have explicit manual origin.  People deserve what they get\nthen.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"}]}