* [PATCH] git-filter-branch: more detailed USAGE
@ 2007-08-30 15:56 Giuseppe Bilotta
2007-08-30 16:20 ` Johannes Sixt
2007-08-30 17:10 ` Giuseppe Bilotta
0 siblings, 2 replies; 12+ messages in thread
From: Giuseppe Bilotta @ 2007-08-30 15:56 UTC (permalink / raw)
To: git; +Cc: Giuseppe Bilotta
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
git-filter-branch.sh | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0190060..9fcab56 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -8,7 +8,16 @@
# a new branch. You can specify a number of filters to modify the commits,
# files and trees.
-USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] [REV-RANGE]"
+USAGE="[-d <tempdir>] \
+[--env-filter <command>] \
+[--tree-filter <command>] \
+[--index-filter <command>] \
+[--parent-filter <command>] \
+[--msg-filter <command>] \
+[--commit-filter <command>] \
+[--tag-name-filter <command>] \
+[--subdirectory-filter <command>] \
+[--original <namespace>] [rev-range]"
. git-sh-setup
warn () {
--
1.5.2.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: more detailed USAGE
2007-08-30 15:56 [PATCH] git-filter-branch: more detailed USAGE Giuseppe Bilotta
@ 2007-08-30 16:20 ` Johannes Sixt
2007-08-30 17:11 ` Giuseppe Bilotta
2007-08-30 17:10 ` Giuseppe Bilotta
1 sibling, 1 reply; 12+ messages in thread
From: Johannes Sixt @ 2007-08-30 16:20 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git
Giuseppe Bilotta schrieb:
> -USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] [REV-RANGE]"
> +USAGE="[-d <tempdir>] \
> +[--env-filter <command>] \
> +[--tree-filter <command>] \
> +[--index-filter <command>] \
> +[--parent-filter <command>] \
> +[--msg-filter <command>] \
> +[--commit-filter <command>] \
> +[--tag-name-filter <command>] \
> +[--subdirectory-filter <command>] \
+[--subdirectory-filter <directory>] \
> +[--original <namespace>] [rev-range]"
-- Hannes
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] git-filter-branch: more detailed USAGE
2007-08-30 15:56 [PATCH] git-filter-branch: more detailed USAGE Giuseppe Bilotta
2007-08-30 16:20 ` Johannes Sixt
@ 2007-08-30 17:10 ` Giuseppe Bilotta
2007-08-30 17:10 ` [PATCH] git-filter-branch: document --original option Giuseppe Bilotta
1 sibling, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2007-08-30 17:10 UTC (permalink / raw)
To: git; +Cc: Giuseppe Bilotta
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
git-filter-branch.sh | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0190060..ec2f75d 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -8,7 +8,13 @@
# a new branch. You can specify a number of filters to modify the commits,
# files and trees.
-USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] [REV-RANGE]"
+USAGE="[--env-filter <command>] [--tree-filter <command>] \
+[--index-filter <command>] [--parent-filter <command>] \
+[--msg-filter <command>] [--commit-filter <command>] \
+[--tag-name-filter <command>] [--subdirectory-filter <directory>] \
+[--original <namespace>] [-d <directory>] [-f | --force] \
+[<rev-list options>...]"
+
. git-sh-setup
warn () {
--
1.5.2.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] git-filter-branch: document --original option
2007-08-30 17:10 ` Giuseppe Bilotta
@ 2007-08-30 17:10 ` Giuseppe Bilotta
2007-08-30 21:55 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2007-08-30 17:10 UTC (permalink / raw)
To: git; +Cc: Giuseppe Bilotta
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
Documentation/git-filter-branch.txt | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 8c43be6..ae03514 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -12,7 +12,8 @@ SYNOPSIS
[--index-filter <command>] [--parent-filter <command>]
[--msg-filter <command>] [--commit-filter <command>]
[--tag-name-filter <command>] [--subdirectory-filter <directory>]
- [-d <directory>] [-f | --force] [<rev-list options>...]
+ [--original <namespace>] [-d <directory>] [-f | --force]
+ [<rev-list options>...]
DESCRIPTION
-----------
@@ -134,6 +135,10 @@ definition impossible to preserve signatures at any rate.)
The result will contain that directory (and only that) as its
project root.
+--original <namespace>::
+ Use this option to set the namespace where the original commits
+ will be stored. The default value is 'refs/original'.
+
-d <directory>::
Use this option to set the path to the temporary directory used for
rewriting. When applying a tree filter, the command needs to
--
1.5.2.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: document --original option
2007-08-30 17:10 ` [PATCH] git-filter-branch: document --original option Giuseppe Bilotta
@ 2007-08-30 21:55 ` Junio C Hamano
2007-08-30 22:00 ` David Kastrup
2007-08-30 23:04 ` Johannes Schindelin
0 siblings, 2 replies; 12+ messages in thread
From: Junio C Hamano @ 2007-08-30 21:55 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git, Johannes Schindelin
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
> +--original <namespace>::
> + Use this option to set the namespace where the original commits
> + will be stored. The default value is 'refs/original'.
> +
The default seems to be "refs/original/".
Even worse.
I think if you say --force --original refs/head (notice the lack
of "s" nor slash at the end), the code will get you in a *lot*
of trouble.
Dscho, don't we want to do something like this?
---
git-filter-branch.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0190060..a7f50a6 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -134,6 +134,7 @@ do
filter_subdir="$OPTARG"
;;
--original)
+ case "$OPTARG" in */) ;; *) OPTARG="$OPTARG/" ;; esac
orig_namespace="$OPTARG"
;;
*)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: document --original option
2007-08-30 21:55 ` Junio C Hamano
@ 2007-08-30 22:00 ` David Kastrup
2007-08-30 22:23 ` Junio C Hamano
2007-08-30 23:04 ` Johannes Schindelin
1 sibling, 1 reply; 12+ messages in thread
From: David Kastrup @ 2007-08-30 22:00 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Giuseppe Bilotta, git, Johannes Schindelin
Junio C Hamano <gitster@pobox.com> writes:
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
>> +--original <namespace>::
>> + Use this option to set the namespace where the original commits
>> + will be stored. The default value is 'refs/original'.
>> +
>
> The default seems to be "refs/original/".
>
> Even worse.
>
> I think if you say --force --original refs/head (notice the lack
> of "s" nor slash at the end), the code will get you in a *lot*
> of trouble.
>
> Dscho, don't we want to do something like this?
>
> ---
> git-filter-branch.sh | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index 0190060..a7f50a6 100755
> --- a/git-filter-branch.sh
> +++ b/git-filter-branch.sh
> @@ -134,6 +134,7 @@ do
> filter_subdir="$OPTARG"
> ;;
> --original)
> + case "$OPTARG" in */) ;; *) OPTARG="$OPTARG/" ;; esac
> orig_namespace="$OPTARG"
> ;;
> *)
orig_namespace="${OPTARG%/}/"
Sure, it does not win the "portable to Version 7" price, but our
scripts don't do that, anyway.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: document --original option
2007-08-30 22:00 ` David Kastrup
@ 2007-08-30 22:23 ` Junio C Hamano
2007-08-30 23:13 ` Junio C Hamano
2007-08-31 6:13 ` David Kastrup
0 siblings, 2 replies; 12+ messages in thread
From: Junio C Hamano @ 2007-08-30 22:23 UTC (permalink / raw)
To: David Kastrup; +Cc: Giuseppe Bilotta, git, Johannes Schindelin
David Kastrup <dak@gnu.org> writes:
> Junio C Hamano <gitster@pobox.com> writes:
> ...
>> --original)
>> + case "$OPTARG" in */) ;; *) OPTARG="$OPTARG/" ;; esac
>> orig_namespace="$OPTARG"
>> ;;
>> *)
>
> orig_namespace="${OPTARG%/}/"
>
> Sure, it does not win the "portable to Version 7" price, but our
> scripts don't do that, anyway.
I agree we do not give the "portable to version 7" prize
anymore. But you made me realize another thing.
I think it should make sure orig_namespace has one and only one
trailing slash, because otherwise "--original refs/heads//"
would lead you to the same disaster.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: document --original option
2007-08-30 22:23 ` Junio C Hamano
@ 2007-08-30 23:13 ` Junio C Hamano
2007-08-31 6:16 ` David Kastrup
2007-08-31 6:13 ` David Kastrup
1 sibling, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2007-08-30 23:13 UTC (permalink / raw)
To: David Kastrup; +Cc: Giuseppe Bilotta, git, Johannes Schindelin
Junio C Hamano <gitster@pobox.com> writes:
> I agree we do not give the "portable to version 7" prize
> anymore. But you made me realize another thing.
>
> I think it should make sure orig_namespace has one and only one
> trailing slash, because otherwise "--original refs/heads//"
> would lead you to the same disaster.
Perhaps,
orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
Well, I know people hate colon-expr, but we earlier ruled out
(and we still do) ${parameter//pattern/string} as bashism beyond
the portability line, and I do not see an alternative easier to
read than this...
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: document --original option
2007-08-30 23:13 ` Junio C Hamano
@ 2007-08-31 6:16 ` David Kastrup
0 siblings, 0 replies; 12+ messages in thread
From: David Kastrup @ 2007-08-31 6:16 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Giuseppe Bilotta, git, Johannes Schindelin
Junio C Hamano <gitster@pobox.com> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> I agree we do not give the "portable to version 7" prize
>> anymore. But you made me realize another thing.
>>
>> I think it should make sure orig_namespace has one and only one
>> trailing slash, because otherwise "--original refs/heads//"
>> would lead you to the same disaster.
>
> Perhaps,
>
> orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
>
See separate proposal which I find still prettier (and which does not
fork).
But I really don't think we should bend over backwards: multiple end
slashes have explicit manual origin. People deserve what they get
then.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: document --original option
2007-08-30 22:23 ` Junio C Hamano
2007-08-30 23:13 ` Junio C Hamano
@ 2007-08-31 6:13 ` David Kastrup
1 sibling, 0 replies; 12+ messages in thread
From: David Kastrup @ 2007-08-31 6:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Giuseppe Bilotta, git, Johannes Schindelin
Junio C Hamano <gitster@pobox.com> writes:
> David Kastrup <dak@gnu.org> writes:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>> ...
>>> --original)
>>> + case "$OPTARG" in */) ;; *) OPTARG="$OPTARG/" ;; esac
>>> orig_namespace="$OPTARG"
>>> ;;
>>> *)
>>
>> orig_namespace="${OPTARG%/}/"
>>
>> Sure, it does not win the "portable to Version 7" price, but our
>> scripts don't do that, anyway.
>
> I agree we do not give the "portable to version 7" prize
> anymore. But you made me realize another thing.
>
> I think it should make sure orig_namespace has one and only one
> trailing slash, because otherwise "--original refs/heads//"
> would lead you to the same disaster.
I am not sure we should bend over backwards to people courting
disaster. Completion does not add double slashes, and that's the most
common cause for spurious slashes. And I don't know an equally
straightforward way to remove multiple slashes at the end.
do orig_namespace="$OPTARG";OPTARG="${OPTARG%/}/"
while test "X${orig_namespace}" != "X${OPTARG}"
is not really all too pretty.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git-filter-branch: document --original option
2007-08-30 21:55 ` Junio C Hamano
2007-08-30 22:00 ` David Kastrup
@ 2007-08-30 23:04 ` Johannes Schindelin
1 sibling, 0 replies; 12+ messages in thread
From: Johannes Schindelin @ 2007-08-30 23:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Giuseppe Bilotta, git
Hi,
On Thu, 30 Aug 2007, Junio C Hamano wrote:
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
> > +--original <namespace>::
> > + Use this option to set the namespace where the original commits
> > + will be stored. The default value is 'refs/original'.
> > +
>
> The default seems to be "refs/original/".
>
> Even worse.
>
> I think if you say --force --original refs/head (notice the lack
> of "s" nor slash at the end), the code will get you in a *lot*
> of trouble.
>
> Dscho, don't we want to do something like this?
Yes, I think so, too. The --original option is probably the least tested
option of filter-branch :-(
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-08-31 6:16 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30 15:56 [PATCH] git-filter-branch: more detailed USAGE Giuseppe Bilotta
2007-08-30 16:20 ` Johannes Sixt
2007-08-30 17:11 ` Giuseppe Bilotta
2007-08-30 17:10 ` Giuseppe Bilotta
2007-08-30 17:10 ` [PATCH] git-filter-branch: document --original option Giuseppe Bilotta
2007-08-30 21:55 ` Junio C Hamano
2007-08-30 22:00 ` David Kastrup
2007-08-30 22:23 ` Junio C Hamano
2007-08-30 23:13 ` Junio C Hamano
2007-08-31 6:16 ` David Kastrup
2007-08-31 6:13 ` David Kastrup
2007-08-30 23:04 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).