git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Improve description of git filter-branch.
@ 2008-03-15 10:39 Ralf Wildenhues
  2008-03-20 15:43 ` Ralf Wildenhues
  2008-03-20 19:31 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Ralf Wildenhues @ 2008-03-15 10:39 UTC (permalink / raw)
  To: git

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
---

Now that I learned about filter-branch, here's my share of nits with its
documentation, a couple of language nits and inaccuracies.

One problem was that I originally understood the manual in the way that
only --env-filter may be used to modify GIT_AUTHOR_NAME etc., and thus
I failed to see how with the fixed order I could change that with data
taken from the tree.  

Also, I think it is quite helpful to state that all filters operate in
the shell environment of the script (this may be an issue for a later
conversion to a builtin).

Cheers,
Ralf

 Documentation/git-filter-branch.txt |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 543a1cf..3f7df04 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -20,12 +20,12 @@ DESCRIPTION
 Lets you rewrite git revision history by rewriting the branches mentioned
 in the <rev-list options>, applying custom filters on each revision.
 Those filters can modify each tree (e.g. removing a file or running
-a perl rewrite on all files) or information about each commit.
+a perl script on all files) or information about each commit.
 Otherwise, all information (including original commit times or merge
 information) will be preserved.
 
 The command will only rewrite the _positive_ refs mentioned in the
-command line (i.e. if you pass 'a..b', only 'b' will be rewritten).
+command line (i.e. if you pass 'a..b', 'a' will not be rewritten).
 If you specify no filters, the commits will be recommitted without any
 changes, which would normally have no effect.  Nevertheless, this may be
 useful in the future for compensating for some git bugs or such,
@@ -42,7 +42,7 @@ Always verify that the rewritten version is correct: The original refs,
 if different from the rewritten ones, will be stored in the namespace
 'refs/original/'.
 
-Note that since this operation is extensively I/O expensive, it might
+Note that since this operation is extremely I/O expensive, it might
 be a good idea to redirect the temporary directory off-disk with the
 '-d' option, e.g. on tmpfs.  Reportedly the speedup is very noticeable.
 
@@ -51,14 +51,15 @@ Filters
 ~~~~~~~
 
 The filters are applied in the order as listed below.  The <command>
-argument is always evaluated in shell using the 'eval' command (with the
-notable exception of the commit filter, for technical reasons).
+argument is always evaluated in the shell context using the 'eval' command
+(with the notable exception of the commit filter, for technical reasons).
 Prior to that, the $GIT_COMMIT environment variable will be set to contain
 the id of the commit being rewritten.  Also, GIT_AUTHOR_NAME,
 GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,
-and GIT_COMMITTER_DATE are set according to the current commit. If any
-evaluation of <command> returns a non-zero exit status, the whole operation
-will be aborted.
+and GIT_COMMITTER_DATE are set according to the current commit.  The values
+of these variables after the filters have run, are used for the new commit.
+If any evaluation of <command> returns a non-zero exit status, the whole
+operation will be aborted.
 
 A 'map' function is available that takes an "original sha1 id" argument
 and outputs a "rewritten sha1 id" if the commit has been already
@@ -71,9 +72,9 @@ OPTIONS
 -------
 
 --env-filter <command>::
-	This is the filter for modifying the environment in which
-	the commit will be performed.  Specifically, you might want
-	to rewrite the author/committer name/email/time environment
+	This filter may be used if you only need to modify the environment
+	in which the commit will be performed.  Specifically, you might
+	want to rewrite the author/committer name/email/time environment
 	variables (see linkgit:git-commit[1] for details).  Do not forget
 	to re-export the variables.
 
@@ -149,7 +150,7 @@ definition impossible to preserve signatures at any rate.)
 -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
-	temporary checkout the tree to some directory, which may consume
+	temporarily checkout the tree to some directory, which may consume
 	considerable space in case of large projects.  By default it
 	does this in the '.git-rewrite/' directory but you can override
 	that choice by this parameter.
-- 
1.5.4.4.603.g1f9f

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Improve description of git filter-branch.
  2008-03-15 10:39 [PATCH] Improve description of git filter-branch Ralf Wildenhues
@ 2008-03-20 15:43 ` Ralf Wildenhues
  2008-03-20 16:42   ` Junio C Hamano
  2008-03-20 19:31 ` Junio C Hamano
  1 sibling, 1 reply; 5+ messages in thread
From: Ralf Wildenhues @ 2008-03-20 15:43 UTC (permalink / raw)
  To: git

<http://thread.gmane.org/gmane.comp.version-control.git/77318>

* Ralf Wildenhues wrote on Sat, Mar 15, 2008 at 11:39:00AM CET:
> 
> Now that I learned about filter-branch, here's my share of nits with its
> documentation, a couple of language nits and inaccuracies.
[...]

I noted that this wasn't applied.  Is there something (or everything? ;-)
wrong with the patch?

Thanks,
Ralf

>  Documentation/git-filter-branch.txt |   25 +++++++++++++------------
>  1 files changed, 13 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Improve description of git filter-branch.
  2008-03-20 15:43 ` Ralf Wildenhues
@ 2008-03-20 16:42   ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2008-03-20 16:42 UTC (permalink / raw)
  To: Ralf Wildenhues; +Cc: git

Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:

> * Ralf Wildenhues wrote on Sat, Mar 15, 2008 at 11:39:00AM CET:
>> 
>> Now that I learned about filter-branch, here's my share of nits with its
>> documentation, a couple of language nits and inaccuracies.
> [...]
>
> I noted that this wasn't applied.  Is there something (or everything? ;-)
> wrong with the patch?

No, but I have not see anybody commented on it, so it was hard to tell if
there was anything good with the patch, either ;-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Improve description of git filter-branch.
  2008-03-15 10:39 [PATCH] Improve description of git filter-branch Ralf Wildenhues
  2008-03-20 15:43 ` Ralf Wildenhues
@ 2008-03-20 19:31 ` Junio C Hamano
  2008-03-20 21:30   ` Ralf Wildenhues
  1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2008-03-20 19:31 UTC (permalink / raw)
  To: Ralf Wildenhues; +Cc: git

Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:

> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
> index 543a1cf..3f7df04 100644
> --- a/Documentation/git-filter-branch.txt
> +++ b/Documentation/git-filter-branch.txt
> @@ -20,12 +20,12 @@ DESCRIPTION
>  Lets you rewrite git revision history by rewriting the branches mentioned
>  in the <rev-list options>, applying custom filters on each revision.
>  Those filters can modify each tree (e.g. removing a file or running
> -a perl rewrite on all files) or information about each commit.
> +a perl script on all files) or information about each commit.
>  Otherwise, all information (including original commit times or merge
>  information) will be preserved.

We could go either way, methinks.  IOW, your update is not worse, but not
a huge improvement either.

>  The command will only rewrite the _positive_ refs mentioned in the
> -command line (i.e. if you pass 'a..b', only 'b' will be rewritten).
> +command line (i.e. if you pass 'a..b', 'a' will not be rewritten).

This one talks about which refs (i.e. pointers to commit DAG) are
rewritten, not about which commits are rewritten.  Because there are only
two things, 'a' and 'b', are involved (remember, the statement does not
talk anything about the commits in between), "only 'b' will" and "'a' will
not" are the same thing.

Saying "only 'b'" would actually make it more consistent with the body of
the description: "We only rewrite _positive_ ones" (i.e. it does not say
"We do not rewrite negative ones").

By the way, that "i.e." should probably be "e.g.".

> @@ -42,7 +42,7 @@ Always verify that the rewritten version is correct: The original refs,
>  if different from the rewritten ones, will be stored in the namespace
>  'refs/original/'.
>  
> -Note that since this operation is extensively I/O expensive, it might
> +Note that since this operation is extremely I/O expensive, it might
>  be a good idea to redirect the temporary directory off-disk with the
>  '-d' option, e.g. on tmpfs.  Reportedly the speedup is very noticeable.

Can we say "very"?  extremely/extensively expensive is using ex'es
excessively to express what can be said in much easier way, I think.

> @@ -51,14 +51,15 @@ Filters
>  ~~~~~~~
>  
>  The filters are applied in the order as listed below.  The <command>
> -argument is always evaluated in shell using the 'eval' command (with the
> -notable exception of the commit filter, for technical reasons).
> +argument is always evaluated in the shell context using the 'eval' command
> +(with the notable exception of the commit filter, for technical reasons).

Ok.

>  Prior to that, the $GIT_COMMIT environment variable will be set to contain
>  the id of the commit being rewritten.  Also, GIT_AUTHOR_NAME,
>  GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,
> -and GIT_COMMITTER_DATE are set according to the current commit. If any
> -evaluation of <command> returns a non-zero exit status, the whole operation
> -will be aborted.
> +and GIT_COMMITTER_DATE are set according to the current commit.  The values
> +of these variables after the filters have run, are used for the new commit.
> +If any evaluation of <command> returns a non-zero exit status, the whole
> +operation will be aborted.

Probably a good clarification, but I am currently too busy to check if the
additional sentence is correct.

> @@ -71,9 +72,9 @@ OPTIONS
>  -------
>  
>  --env-filter <command>::
> -	This is the filter for modifying the environment in which
> -	the commit will be performed.  Specifically, you might want
> -	to rewrite the author/committer name/email/time environment
> +	This filter may be used if you only need to modify the environment
> +	in which the commit will be performed.  Specifically, you might
> +	want to rewrite the author/committer name/email/time environment

Ok.  Without needless line rewrapping this would have been much less time
consuming to review, though.

> @@ -149,7 +150,7 @@ definition impossible to preserve signatures at any rate.)
>  -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
> -	temporary checkout the tree to some directory, which may consume
> +	temporarily checkout the tree to some directory, which may consume

Ok, but isn't the verb to "check out" two words?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Improve description of git filter-branch.
  2008-03-20 19:31 ` Junio C Hamano
@ 2008-03-20 21:30   ` Ralf Wildenhues
  0 siblings, 0 replies; 5+ messages in thread
From: Ralf Wildenhues @ 2008-03-20 21:30 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
---

* Junio C Hamano wrote on Thu, Mar 20, 2008 at 08:31:42PM CET:
> Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
> 
> > +	This filter may be used if you only need to modify the environment
> > +	in which the commit will be performed.  Specifically, you might
> > +	want to rewrite the author/committer name/email/time environment
> 
> Ok.  Without needless line rewrapping this would have been much less time
> consuming to review, though.

Apologies, and thanks for the review.  Here's an updated patch.

Cheers,
Ralf

 Documentation/git-filter-branch.txt |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 543a1cf..2a78549 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -25,7 +25,7 @@ Otherwise, all information (including original commit times or merge
 information) will be preserved.
 
 The command will only rewrite the _positive_ refs mentioned in the
-command line (i.e. if you pass 'a..b', only 'b' will be rewritten).
+command line (e.g. if you pass 'a..b', only 'b' will be rewritten).
 If you specify no filters, the commits will be recommitted without any
 changes, which would normally have no effect.  Nevertheless, this may be
 useful in the future for compensating for some git bugs or such,
@@ -42,7 +42,7 @@ Always verify that the rewritten version is correct: The original refs,
 if different from the rewritten ones, will be stored in the namespace
 'refs/original/'.
 
-Note that since this operation is extensively I/O expensive, it might
+Note that since this operation is very I/O expensive, it might
 be a good idea to redirect the temporary directory off-disk with the
 '-d' option, e.g. on tmpfs.  Reportedly the speedup is very noticeable.
 
@@ -51,14 +51,15 @@ Filters
 ~~~~~~~
 
 The filters are applied in the order as listed below.  The <command>
-argument is always evaluated in shell using the 'eval' command (with the
-notable exception of the commit filter, for technical reasons).
+argument is always evaluated in the shell context using the 'eval' command
+(with the notable exception of the commit filter, for technical reasons).
 Prior to that, the $GIT_COMMIT environment variable will be set to contain
 the id of the commit being rewritten.  Also, GIT_AUTHOR_NAME,
 GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,
-and GIT_COMMITTER_DATE are set according to the current commit. If any
-evaluation of <command> returns a non-zero exit status, the whole operation
-will be aborted.
+and GIT_COMMITTER_DATE are set according to the current commit.  The values
+of these variables after the filters have run, are used for the new commit.
+If any evaluation of <command> returns a non-zero exit status, the whole
+operation will be aborted.
 
 A 'map' function is available that takes an "original sha1 id" argument
 and outputs a "rewritten sha1 id" if the commit has been already
@@ -71,9 +72,9 @@ OPTIONS
 -------
 
 --env-filter <command>::
-	This is the filter for modifying the environment in which
-	the commit will be performed.  Specifically, you might want
-	to rewrite the author/committer name/email/time environment
+	This filter may be used if you only need to modify the environment
+	in which the commit will be performed.  Specifically, you might
+	want to rewrite the author/committer name/email/time environment
 	variables (see linkgit:git-commit[1] for details).  Do not forget
 	to re-export the variables.
 
@@ -149,7 +150,7 @@ definition impossible to preserve signatures at any rate.)
 -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
-	temporary checkout the tree to some directory, which may consume
+	temporarily check out the tree to some directory, which may consume
 	considerable space in case of large projects.  By default it
 	does this in the '.git-rewrite/' directory but you can override
 	that choice by this parameter.
-- 
1.5.5.rc0.22.g65daf

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-20 21:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-15 10:39 [PATCH] Improve description of git filter-branch Ralf Wildenhues
2008-03-20 15:43 ` Ralf Wildenhues
2008-03-20 16:42   ` Junio C Hamano
2008-03-20 19:31 ` Junio C Hamano
2008-03-20 21:30   ` Ralf Wildenhues

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).