git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] doc: list filter-branch subdirectory-filter first
@ 2017-10-16 23:17 David Glasser
  2017-10-17  2:46 ` Junio C Hamano
  2017-10-17  9:45 ` [PATCH v2] " David Glasser
  0 siblings, 2 replies; 4+ messages in thread
From: David Glasser @ 2017-10-16 23:17 UTC (permalink / raw)
  To: git

From: David Glasser <glasser@davidglasser.net>

The docs claim that filters are applied in the listed order, so
subdirectory-filter should come first.
---
 Documentation/git-filter-branch.txt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 9e5169aa64f4f..605583c0ad2b5 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -89,6 +89,11 @@ OPTIONS
 	can be used or modified in the following filter steps except
 	the commit filter, for technical reasons.
 
+--subdirectory-filter <directory>::
+	Only look at the history which touches the given subdirectory.
+	The result will contain that directory (and only that) as its
+	project root. Implies <<Remap_to_ancestor>>.
+
 --env-filter <command>::
 	This filter may be used if you only need to modify the environment
 	in which the commit will be performed.  Specifically, you might
@@ -167,11 +172,6 @@ be removed, buyer beware. There is also no support for changing the
 author or timestamp (or the tag message for that matter). Tags which point
 to other tags will be rewritten to point to the underlying commit.
 
---subdirectory-filter <directory>::
-	Only look at the history which touches the given subdirectory.
-	The result will contain that directory (and only that) as its
-	project root. Implies <<Remap_to_ancestor>>.
-
 --prune-empty::
 	Some filters will generate empty commits that leave the tree untouched.
 	This option instructs git-filter-branch to remove such commits if they

--
https://github.com/git/git/pull/415

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

* Re: [PATCH] doc: list filter-branch subdirectory-filter first
  2017-10-16 23:17 [PATCH] doc: list filter-branch subdirectory-filter first David Glasser
@ 2017-10-17  2:46 ` Junio C Hamano
  2017-10-17  9:45 ` [PATCH v2] " David Glasser
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2017-10-17  2:46 UTC (permalink / raw)
  To: David Glasser; +Cc: git

David Glasser <glasser@meteor.com> writes:

> From: David Glasser <glasser@davidglasser.net>
>
> The docs claim that filters are applied in the listed order, so
> subdirectory-filter should come first.
> ---
>  Documentation/git-filter-branch.txt | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Good.  Could you sign it off?

Somewhat related tangent is that we may want to also reorder the
output from "git filter-branch -h" to the order of filter
application.  For that matter, the order in which the SYNOPSIS
section lists these command line arguments may want to match, both
for consistency and as an extra reminder to the users.


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

* [PATCH v2] doc: list filter-branch subdirectory-filter first
  2017-10-16 23:17 [PATCH] doc: list filter-branch subdirectory-filter first David Glasser
  2017-10-17  2:46 ` Junio C Hamano
@ 2017-10-17  9:45 ` David Glasser
  2017-10-18  0:11   ` Junio C Hamano
  1 sibling, 1 reply; 4+ messages in thread
From: David Glasser @ 2017-10-17  9:45 UTC (permalink / raw)
  To: git

From: David Glasser <glasser@davidglasser.net>

The docs claim that filters are applied in the listed order, so
subdirectory-filter should come first.

For consistency, apply the same order to the SYNOPSIS and the script's usage, as
well as the switch while parsing arguments.

Add missing --prune-empty to the script's usage.

Signed-off-by: David Glasser <glasser@davidglasser.net>
---
 Documentation/git-filter-branch.txt | 20 ++++++++++----------
 git-filter-branch.sh                | 20 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 9e5169aa64f4f..394f74451a659 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -8,11 +8,11 @@ git-filter-branch - Rewrite branches
 SYNOPSIS
 --------
 [verse]
-'git filter-branch' [--setup <command>] [--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>] [--prune-empty]
+'git filter-branch' [--setup <command>] [--subdirectory-filter <directory>]
+	[--env-filter <command>] [--tree-filter <command>]
+	[--index-filter <command>] [--parent-filter <command>]
+	[--msg-filter <command>] [--commit-filter <command>]
+	[--tag-name-filter <command>] [--prune-empty]
 	[--original <namespace>] [-d <directory>] [-f | --force]
 	[--] [<rev-list options>...]
 
@@ -89,6 +89,11 @@ OPTIONS
 	can be used or modified in the following filter steps except
 	the commit filter, for technical reasons.
 
+--subdirectory-filter <directory>::
+	Only look at the history which touches the given subdirectory.
+	The result will contain that directory (and only that) as its
+	project root. Implies <<Remap_to_ancestor>>.
+
 --env-filter <command>::
 	This filter may be used if you only need to modify the environment
 	in which the commit will be performed.  Specifically, you might
@@ -167,11 +172,6 @@ be removed, buyer beware. There is also no support for changing the
 author or timestamp (or the tag message for that matter). Tags which point
 to other tags will be rewritten to point to the underlying commit.
 
---subdirectory-filter <directory>::
-	Only look at the history which touches the given subdirectory.
-	The result will contain that directory (and only that) as its
-	project root. Implies <<Remap_to_ancestor>>.
-
 --prune-empty::
 	Some filters will generate empty commits that leave the tree untouched.
 	This option instructs git-filter-branch to remove such commits if they
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 3a74602ef3771..b7827e745a92a 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -81,12 +81,12 @@ set_ident () {
 	finish_ident COMMITTER
 }
 
-USAGE="[--setup <command>] [--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]
+USAGE="[--setup <command>] [--subdirectory-filter <directory>]
+	[--env-filter <command>] [--tree-filter <command>]
+	[--index-filter <command>] [--parent-filter <command>]
+	[--msg-filter <command>] [--commit-filter <command>]
+	[--tag-name-filter <command>] [--prune-empty]
+	[--original <namespace>] [-d <directory>] [-f | --force]
 	[--] [<rev-list options>...]"
 
 OPTIONS_SPEC=
@@ -153,6 +153,10 @@ do
 	--setup)
 		filter_setup="$OPTARG"
 		;;
+	--subdirectory-filter)
+		filter_subdir="$OPTARG"
+		remap_to_ancestor=t
+		;;
 	--env-filter)
 		filter_env="$OPTARG"
 		;;
@@ -174,10 +178,6 @@ do
 	--tag-name-filter)
 		filter_tag_name="$OPTARG"
 		;;
-	--subdirectory-filter)
-		filter_subdir="$OPTARG"
-		remap_to_ancestor=t
-		;;
 	--original)
 		orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
 		;;

--
https://github.com/git/git/pull/415

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

* Re: [PATCH v2] doc: list filter-branch subdirectory-filter first
  2017-10-17  9:45 ` [PATCH v2] " David Glasser
@ 2017-10-18  0:11   ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2017-10-18  0:11 UTC (permalink / raw)
  To: David Glasser; +Cc: git

David Glasser <glasser@meteor.com> writes:

> From: David Glasser <glasser@davidglasser.net>
>
> The docs claim that filters are applied in the listed order, so
> subdirectory-filter should come first.
>
> For consistency, apply the same order to the SYNOPSIS and the script's usage, as
> well as the switch while parsing arguments.
>
> Add missing --prune-empty to the script's usage.
>
> Signed-off-by: David Glasser <glasser@davidglasser.net>
> ---

Thanks for being extra careful.  Will queue.

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

end of thread, other threads:[~2017-10-18  0:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 23:17 [PATCH] doc: list filter-branch subdirectory-filter first David Glasser
2017-10-17  2:46 ` Junio C Hamano
2017-10-17  9:45 ` [PATCH v2] " David Glasser
2017-10-18  0:11   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).