{"thread":{"id":"16091","subject":"[PATCH] git-filter-branch: Add an example on how to remove empty commits","startedAt":"2008-10-30T00:33:53Z","lastAt":"2009-01-11T20:55:21Z","messageCount":25,"participants":["Petr Baudis","Johannes Schindelin","Sam Vilain","Pierre Habouzit","Deskin Miller","Junio C Hamano","Jay Soffian","Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"94256","messageId":"1225326833-15210-1-git-send-email-pasky@suse.cz","threadId":"16091","inReplyTo":null,"subject":"[PATCH] git-filter-branch: Add an example on how to remove empty commits","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-10-30T00:33:53Z","receivedAt":"2008-10-30T00:33:53Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"From: Sverre Rabbelier <srabbelier@gmail.com>\n\nSigned-off-by: Sverre Rabbelier <srabbelier@gmail.com>\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n Documentation/git-filter-branch.txt |   15 +++++++++++++++\n 1 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex fed6de6..2565244 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -246,6 +246,21 @@ git filter-branch --commit-filter '\n \tfi' HEAD\n ------------------------------------------------------------------------------\n \n+To remove commits that are empty (do not introduce any change):\n+\n+------------------------------------------------------------------------------\n+git rev-list HEAD | while read c; do [ -n \"$(git diff-tree --root $c)\" ] || echo $c; done > revs\n+\n+git filter-branch --commit-filter '\n+  if grep -q \"$GIT_COMMIT\" '\"$(pwd)/\"revs';\n+  then\n+    skip_commit \"$@\";\n+  else\n+    git commit-tree \"$@\";\n+  fi' HEAD\n+\n+------------------------------------------------------------------------------\n+\n The function 'skip_commit' is defined as follows:\n \n --------------------------\n-- \n1.5.6.3.536.g61aad\n"},{"id":"94259","messageId":"1225327159.21951.15.camel@maia.lan","threadId":"16091","inReplyTo":"1225326833-15210-1-git-send-email-pasky@suse.cz","subject":"Re: [PATCH] git-filter-branch: Add an example on how to remove empty commits","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-10-30T00:39:19Z","receivedAt":"2008-10-30T00:39:19Z","isPatch":true,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"On Wed, 2008-10-29 at 17:33 -0700, Petr Baudis wrote:\n> +To remove commits that are empty (do not introduce any change):\n> +\n> +------------------------------------------------------------------------------\n> +git rev-list HEAD | while read c; do [ -n \"$(git diff-tree --root $c)\" ] || echo $c; done > revs\n> +\n> +git filter-branch --commit-filter '\n> +  if grep -q \"$GIT_COMMIT\" '\"$(pwd)/\"revs';\n> +  then\n\nWhy not put the git diff-tree in the commit filter?\n\nIs this tested?  It doesn't look like it does what the comment says...\nsurely you have to compare with the previous commit, not the null\ncommit?\n\nSam.\n"},{"id":"94258","messageId":"alpine.DEB.1.00.0810300151480.22125@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"16091","inReplyTo":"1225326833-15210-1-git-send-email-pasky@suse.cz","subject":"Re: [PATCH] git-filter-branch: Add an example on how to remove empty commits","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-10-30T00:56:16Z","receivedAt":"2008-10-30T00:56:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 29 Oct 2008, Petr Baudis wrote:\n\n> +To remove commits that are empty (do not introduce any change):\n> +\n> +------------------------------------------------------------------------------\n> +git rev-list HEAD | while read c; do [ -n \"$(git diff-tree --root $c)\" ] || echo $c; done > revs\n> +\n> +git filter-branch --commit-filter '\n> +  if grep -q \"$GIT_COMMIT\" '\"$(pwd)/\"revs';\n> +  then\n> +    skip_commit \"$@\";\n> +  else\n> +    git commit-tree \"$@\";\n> +  fi' HEAD\n\nYou would not need to use the temporary \"revs\" file by using something \n(totally untested, of course):\n\ngit filter-branch --commit-filter '\n  if git diff-tree --exit-status -q \"$GIT_COMMIT\";\n  then\n    git commit-tree \"$@\";\n  else\n    skip_commit \"$@\";\n  fi' HEAD\n\nOf course, you could also mention that you could use\n\n\tgit log --cherry-pick -p --pretty=format: ..<branch>@{1}\n\nto verify that all skipped commits had empty diffs.  That one is also \ntotally untested.\n\nCiao,\nDscho\n"},{"id":"94284","messageId":"20081030132623.GC24098@artemis.corp","threadId":"16091","inReplyTo":"1225326833-15210-1-git-send-email-pasky@suse.cz","subject":"Re: [PATCH] git-filter-branch: Add an example on how to remove empty commits","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-30T13:26:23Z","receivedAt":"2008-10-30T13:26:23Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, Oct 30, 2008 at 12:33:53AM +0000, Petr Baudis wrote:\n> From: Sverre Rabbelier <srabbelier@gmail.com>\n> \n> Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>\n> Signed-off-by: Petr Baudis <pasky@suse.cz>\n> ---\n>  Documentation/git-filter-branch.txt |   15 +++++++++++++++\n>  1 files changed, 15 insertions(+), 0 deletions(-)\n> \n> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\n> index fed6de6..2565244 100644\n> --- a/Documentation/git-filter-branch.txt\n> +++ b/Documentation/git-filter-branch.txt\n> @@ -246,6 +246,21 @@ git filter-branch --commit-filter '\n>  \tfi' HEAD\n>  ------------------------------------------------------------------------------\n>  \n> +To remove commits that are empty (do not introduce any change):\n> +\n> +------------------------------------------------------------------------------\n> +git rev-list HEAD | while read c; do [ -n \"$(git diff-tree --root $c)\" ] || echo $c; done > revs\n> +\n> +git filter-branch --commit-filter '\n> +  if grep -q \"$GIT_COMMIT\" '\"$(pwd)/\"revs';\n> +  then\n> +    skip_commit \"$@\";\n> +  else\n> +    git commit-tree \"$@\";\n> +  fi' HEAD\n> +\n> +------------------------------------------------------------------------------\n\nWhy not add an option to filter-branch that removes a commit if it's\nempty ? It's quite useful, it helps the user concentrating on just\nkeeping what matches *his* criteriums, and not caring about the minor\ndetails of cleansing the result.\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"94300","messageId":"20081030150617.GA14098@euler","threadId":"16091","inReplyTo":"20081030132623.GC24098@artemis.corp","subject":"Re: [PATCH] git-filter-branch: Add an example on how to remove empty commits","fromName":"Deskin Miller","fromEmail":"deskinm@umich.edu","sentAt":"2008-10-30T15:06:18Z","receivedAt":"2008-10-30T15:06:18Z","isPatch":true,"sender":{"key":"deskinm@umich.edu","avatar":"https://gravatar.com/avatar/d340a0e612cdf0a79535c71863c0b4c535e9aba63b42032226ae903e638b64f9?d=mp&s=160"},"body":"On Thu, Oct 30, 2008 at 02:26:23PM +0100, Pierre Habouzit wrote:\n> Why not add an option to filter-branch that removes a commit if it's\n> empty ? It's quite useful, it helps the user concentrating on just\n> keeping what matches *his* criteriums, and not caring about the minor\n> details of cleansing the result.\n\nI've thought this would be useful at times myself.  One potential complication,\nhowever, is that the history could come from a SVN repository via git-svn, in\nwhich case it's possible that empty commits exist due to an incomplete mapping\nof SVN's changes, e.g. SVN property changes will get their own revision, even\nif the file content does not change.\n\nTherefore, if one were to write a patch such as Pierre suggests, I'd strongly\nsuggest checking the commit message first for any git-svn-id: line, and either\nrefusing to work without some --force option from the user, or giving a strong\nwarning to the user that their git-svn setup may not work properly any more,\nand clear instructions on how to recover those refs, or update the svn-related\nmetadata.\n\nOn further thought, automatically updating the svn metadata might be useful to\nadd as an option to filter-branch regardless; I'll think about that some\nmyself, any thoughts from others?\n\nMy $0.02,\nDeskin Miller\n"},{"id":"94301","messageId":"20081030151042.GH24098@artemis.corp","threadId":"16091","inReplyTo":"20081030150617.GA14098@euler","subject":"Re: [PATCH] git-filter-branch: Add an example on how to remove empty commits","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-30T15:10:42Z","receivedAt":"2008-10-30T15:10:42Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Thu, Oct 30, 2008 at 03:06:18PM +0000, Deskin Miller wrote:\n> On Thu, Oct 30, 2008 at 02:26:23PM +0100, Pierre Habouzit wrote:\n> > Why not add an option to filter-branch that removes a commit if it's\n> > empty ? It's quite useful, it helps the user concentrating on just\n> > keeping what matches *his* criteriums, and not caring about the minor\n> > details of cleansing the result.\n> \n> I've thought this would be useful at times myself.  One potential complication,\n> however, is that the history could come from a SVN repository via git-svn, in\n> which case it's possible that empty commits exist due to an incomplete mapping\n> of SVN's changes, e.g. SVN property changes will get their own revision, even\n> if the file content does not change.\n\nWell, if you want to migrate your git-svn repository to something else,\nit doesn't makes sense to add this limitation. I'd rather see this\n\"problem\" advertized in the manual page, rather than a limitation added.\n\nNote that using git filter-branch on a git-svn repository and still\nexpecting it to work with git-svn is IMHO wrong in so many ways that we\nshould not really try that hard to prevent the user doing something\nstupid anyways.\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"94309","messageId":"1225383538-23666-1-git-send-email-madcoder@debian.org","threadId":"16091","inReplyTo":"20081030132623.GC24098@artemis.corp","subject":"filter-branch enhancements","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-30T16:18:56Z","receivedAt":"2008-10-30T16:18:56Z","isPatch":false,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"The first patch is about making git-filter-branch use parse options, and\nis independant, but the current state made my eyes bleed, and I wanted\nto work on the second patch ;)\n\nThe second patch is more a request for comments, and if people think\nit's useful, I'll try to check it actually works, and write some tests\nfor it.\n"},{"id":"94308","messageId":"1225383538-23666-2-git-send-email-madcoder@debian.org","threadId":"16091","inReplyTo":"1225383538-23666-1-git-send-email-madcoder@debian.org","subject":"[PATCH] make git-filter-branch use parse-options.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-30T16:18:57Z","receivedAt":"2008-10-30T16:18:57Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"Signed-off-by: Pierre Habouzit <madcoder@debian.org>\n---\n git-filter-branch.sh |   93 +++++++++++++++++++++-----------------------------\n 1 files changed, 39 insertions(+), 54 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 81392ad..8af3126 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -87,14 +87,26 @@ set_ident () {\n \techo \"case \\\"\\$GIT_${uid}_NAME\\\" in \\\"\\\") GIT_${uid}_NAME=\\\"\\${GIT_${uid}_EMAIL%%@*}\\\" && export GIT_${uid}_NAME;; esac\"\n }\n \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-OPTIONS_SPEC=\n+OPTIONS_KEEPDASHDASH=\n+OPTIONS_SPEC=\"\\\n+git filter-branch [options] [<rev-list options>...]\n+--\n+d=                      temporary path to use for rewriting\n+f,force                 force filter-branch to run\n+subdirectory-filter=    only look at the history touching that specific subdirectory\n+original=               namespace where the original commits will be stored (default: refs/original)\n+\n+ Filters that you can run:\n+\n+env-filter=             environment filter to run\n+tree-filter=            tree rewriting filter to run\n+index-filter=           index rewriting filter to run\n+parent-filter=          parent rewriting filter to run\n+msg-filter=             commit message rewriting filter to run\n+commit-filter=          commit rewriting filter to run\n+tag-name-filter=        tag name rewriting filter to run\n+\"\n+\n . git-sh-setup\n \n if [ \"$(is_bare_repository)\" = false ]; then\n@@ -117,63 +129,36 @@ force=\n while :\n do\n \tcase \"$1\" in\n-\t--)\n-\t\tshift\n-\t\tbreak\n-\t\t;;\n \t--force|-f)\n-\t\tshift\n-\t\tforce=t\n-\t\tcontinue\n-\t\t;;\n-\t-*)\n-\t\t;;\n-\t*)\n-\t\tbreak;\n-\tesac\n-\n-\t# all switches take one argument\n-\tARG=\"$1\"\n-\tcase \"$#\" in 1) usage ;; esac\n-\tshift\n-\tOPTARG=\"$1\"\n-\tshift\n-\n-\tcase \"$ARG\" in\n+\t\tforce=t;;\n \t-d)\n-\t\ttempdir=\"$OPTARG\"\n-\t\t;;\n+\t\ttempdir=\"$2\"; shift;;\n+\t--subdirectory-filter)\n+\t\tfilter_subdir=\"$2\"; shift;;\n+\t--original)\n+\t\torig_namespace=$(expr \"$2/\" : '\\(.*[^/]\\)/*$')/\n+\t\tshift;;\n+\n \t--env-filter)\n-\t\tfilter_env=\"$OPTARG\"\n-\t\t;;\n+\t\tfilter_env=\"$2\"; shift;;\n \t--tree-filter)\n-\t\tfilter_tree=\"$OPTARG\"\n-\t\t;;\n+\t\tfilter_tree=\"$2\"; shift;;\n \t--index-filter)\n-\t\tfilter_index=\"$OPTARG\"\n-\t\t;;\n+\t\tfilter_index=\"$2\"; shift;;\n \t--parent-filter)\n-\t\tfilter_parent=\"$OPTARG\"\n-\t\t;;\n+\t\tfilter_parent=\"$2\"; shift;;\n \t--msg-filter)\n-\t\tfilter_msg=\"$OPTARG\"\n-\t\t;;\n+\t\tfilter_msg=\"$2\"; shift;;\n \t--commit-filter)\n-\t\tfilter_commit=\"$functions; $OPTARG\"\n-\t\t;;\n+\t\tfilter_commit=\"$functions; $2\"; shift;;\n \t--tag-name-filter)\n-\t\tfilter_tag_name=\"$OPTARG\"\n-\t\t;;\n-\t--subdirectory-filter)\n-\t\tfilter_subdir=\"$OPTARG\"\n-\t\t;;\n-\t--original)\n-\t\torig_namespace=$(expr \"$OPTARG/\" : '\\(.*[^/]\\)/*$')/\n-\t\t;;\n+\t\tfilter_tag_name=\"$2\"; shift;;\n+\t--)\n+\t\tshift; break;;\n \t*)\n-\t\tusage\n-\t\t;;\n+\t\tusage;;\n \tesac\n+\tshift\n done\n \n case \"$force\" in\n-- \n1.6.0.3.758.gc29b0\n"},{"id":"94310","messageId":"1225383538-23666-3-git-send-email-madcoder@debian.org","threadId":"16091","inReplyTo":"1225383538-23666-2-git-send-email-madcoder@debian.org","subject":"[Proof of concept PATCH] implement --prune-empty switch for filter-branch","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-30T16:18:58Z","receivedAt":"2008-10-30T16:18:58Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"This is not a real patch (lacks a test at least) and is absolutely not\ntested, though should basically work as expected.\n\nThis is only meant as a basis for discussion.\n\nSigned-off-by: Pierre Habouzit <madcoder@debian.org>\n---\n Documentation/git-filter-branch.txt |   14 ++++++++++++++\n git-filter-branch.sh                |   26 +++++++++++++++++++++++++-\n 2 files changed, 39 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex fed6de6..451950b 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -122,6 +122,10 @@ You can use the 'map' convenience function in this filter, and other\n convenience functions, too.  For example, calling 'skip_commit \"$@\"'\n will leave out the current commit (but not its changes! If you want\n that, use 'git-rebase' instead).\n++\n+You can also use the 'git_commit_non_empty_tree \"$@\"' instead of\n+'git commit-tree \"$@\"' if you don't wish to keep commits with a single parent\n+and that makes no change to the tree.\n \n --tag-name-filter <command>::\n \tThis is the filter for rewriting tag names. When passed,\n@@ -151,6 +155,16 @@ to other tags will be rewritten to point to the underlying commit.\n \tThe result will contain that directory (and only that) as its\n \tproject root.\n \n+--prune-empty::\n+\tSome kind of filters will generate empty commits, that left the tree\n+\tuntouched.  This switch allow git-filter-branch to ignore such\n+\tcommits.  Though, this switch only applies for commits that have one\n+\tand only one parent, it will hence keep merges points. Also, this\n+\toption is not compatible with the use of '--commit-filter'. Though you\n+\tjust need to use the function 'git_commit_non_empty_tree \"$@\"' instead\n+\tof the 'git commit-tree \"$@\"' idiom in your commit filter to make that\n+\thappen.\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'.\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 8af3126..9c83402 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -49,6 +49,15 @@ die()\n \techo \"$*\" >&2\n \texit 1\n }\n+\n+git_commit_non_empty_tree()\n+{\n+\tif test $# = 3 && test \"$1\" = $(git rev-parse \"$3^{tree}\"); then\n+\t\tmap \"$3\"\n+\telse\n+\t\tgit commit-tree \"$@\"\n+\tfi\n+}\n EOF\n )\n \n@@ -95,6 +104,7 @@ d=                      temporary path to use for rewriting\n f,force                 force filter-branch to run\n subdirectory-filter=    only look at the history touching that specific subdirectory\n original=               namespace where the original commits will be stored (default: refs/original)\n+prune-empty             use this if you want to automatically prune empty commits\n \n  Filters that you can run:\n \n@@ -121,11 +131,12 @@ filter_tree=\n filter_index=\n filter_parent=\n filter_msg=cat\n-filter_commit='git commit-tree \"$@\"'\n+filter_commit=\n filter_tag_name=\n filter_subdir=\n orig_namespace=refs/original/\n force=\n+prune_empty=\n while :\n do\n \tcase \"$1\" in\n@@ -138,6 +149,8 @@ do\n \t--original)\n \t\torig_namespace=$(expr \"$2/\" : '\\(.*[^/]\\)/*$')/\n \t\tshift;;\n+\t--prune-empty)\n+\t\tprune_empty=t;;\n \n \t--env-filter)\n \t\tfilter_env=\"$2\"; shift;;\n@@ -161,6 +174,17 @@ do\n \tshift\n done\n \n+case \"$prune_empty,$filter_commit\" in\n+',')\n+\tfilter_commit='git commit-tree \"$@\"';;\n+'t,')\n+\tfilter_commit='git_commit_non_empty_tree \"$@\"';;\n+','*)\n+\t;;\n+*)\n+\tdie \"Cannot set --prune-empty and --filter-commit at the same time\"\n+esac\n+\n case \"$force\" in\n t)\n \trm -rf \"$tempdir\"\n-- \n1.6.0.3.758.gc29b0\n"},{"id":"94379","messageId":"20081031082209.GB21015@artemis.corp","threadId":"16091","inReplyTo":"1225383538-23666-2-git-send-email-madcoder@debian.org","subject":"Re: [PATCH] make git-filter-branch use parse-options.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-31T08:22:09Z","receivedAt":"2008-10-31T08:22:09Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"Okay this patch prevents us to use rev-list options in fact, which is\nbroken I guess, since it prevents --not and a few similar arguments that\ncan make sense. Please do not apply, I'll try to rework the next patch\nthough since nobody complained, it's that it looks fine :p\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"94384","messageId":"1225445204-28000-1-git-send-email-madcoder@debian.org","threadId":"16091","inReplyTo":"20081030132623.GC24098@artemis.corp","subject":"[PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-31T09:26:44Z","receivedAt":"2008-10-31T09:26:44Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"git_commit_non_empty_tree is added to the functions that can be run from\ncommit filters. Its effect is to commit only commits actually touching the\ntree and that are not merge points either.\n\nThe option --prune-empty is added. It defaults the commit-filter to\n'git_commit_non_empty_tree \"$@\"', and can be used with any other\ncombination of filters, except --commit-hook that must used\n'git_commit_non_empty_tree \"$@\"' where one puts 'git commit-tree \"$@\"'\nusually to achieve the same result.\n\nSigned-off-by: Pierre Habouzit <madcoder@debian.org>\n---\n\n  Okay, this one is meant for inclusion, and has a test case.\n\n  Note that this prune-empty option is not 100% perfect, for example, it won't\n  prune an empty base (an empty commit whose parent is 0000000) since it has\n  no parent, or won't reduce histories this way:\n\n     t0---t1---t1            t0---t1\n              /     ---->        /\n             t2                t2\n\n  But I don't think it's especially bad since such trees happen when one does\n  'git merge -s ours' all the time, and I don't think git-filter-branch should\n  erase those (I mean some people may want to, but then they can figure out\n  how to do that by themselves, I don't think it's a common wish).\n\n  The goal of --prune-empty is rather meant to be used e.g. when you remove a\n  file from your history, and want to get rid of commits that only touched it,\n  or that you want to extract the history of a given subdirectory only and\n  remove commits that didn't touch that directory.\n\n Documentation/git-filter-branch.txt |   14 ++++++++++++++\n git-filter-branch.sh                |   29 ++++++++++++++++++++++++++++-\n t/t7003-filter-branch.sh            |    8 ++++++++\n 3 files changed, 50 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex fed6de6..451950b 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -122,6 +122,10 @@ You can use the 'map' convenience function in this filter, and other\n convenience functions, too.  For example, calling 'skip_commit \"$@\"'\n will leave out the current commit (but not its changes! If you want\n that, use 'git-rebase' instead).\n++\n+You can also use the 'git_commit_non_empty_tree \"$@\"' instead of\n+'git commit-tree \"$@\"' if you don't wish to keep commits with a single parent\n+and that makes no change to the tree.\n \n --tag-name-filter <command>::\n \tThis is the filter for rewriting tag names. When passed,\n@@ -151,6 +155,16 @@ to other tags will be rewritten to point to the underlying commit.\n \tThe result will contain that directory (and only that) as its\n \tproject root.\n \n+--prune-empty::\n+\tSome kind of filters will generate empty commits, that left the tree\n+\tuntouched.  This switch allow git-filter-branch to ignore such\n+\tcommits.  Though, this switch only applies for commits that have one\n+\tand only one parent, it will hence keep merges points. Also, this\n+\toption is not compatible with the use of '--commit-filter'. Though you\n+\tjust need to use the function 'git_commit_non_empty_tree \"$@\"' instead\n+\tof the 'git commit-tree \"$@\"' idiom in your commit filter to make that\n+\thappen.\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'.\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 81392ad..4827934 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -40,6 +40,16 @@ skip_commit()\n \tdone;\n }\n \n+# if you run 'git_commit_non_empty_tree \"$@\"' in a commit filter,\n+# it will skip commits that leave the tree untouched, commit the other.\n+git_commit_non_empty_tree()\n+{\n+\tif test $# = 3 && test \"$1\" = $(git rev-parse \"$3^{tree}\"); then\n+\t\tmap \"$3\"\n+\telse\n+\t\tgit commit-tree \"$@\"\n+\tfi\n+}\n # override die(): this version puts in an extra line break, so that\n # the progress is still visible\n \n@@ -109,11 +119,12 @@ filter_tree=\n filter_index=\n filter_parent=\n filter_msg=cat\n-filter_commit='git commit-tree \"$@\"'\n+filter_commit=\n filter_tag_name=\n filter_subdir=\n orig_namespace=refs/original/\n force=\n+prune_empty=\n while :\n do\n \tcase \"$1\" in\n@@ -126,6 +137,11 @@ do\n \t\tforce=t\n \t\tcontinue\n \t\t;;\n+\t--prune-empty)\n+\t\tshift\n+\t\tprune_empty=t\n+\t\tcontinue\n+\t\t;;\n \t-*)\n \t\t;;\n \t*)\n@@ -176,6 +192,17 @@ do\n \tesac\n done\n \n+case \"$prune_empty,$filter_commit\" in\n+',')\n+\tfilter_commit='git commit-tree \"$@\"';;\n+'t,')\n+\tfilter_commit=\"$functions;\"' git_commit_non_empty_tree \"$@\"';;\n+','*)\n+\t;;\n+*)\n+\tdie \"Cannot set --prune-empty and --filter-commit at the same time\"\n+esac\n+\n case \"$force\" in\n t)\n \trm -rf \"$tempdir\"\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex b0a9d7d..352b56b 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -262,4 +262,12 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'Prune empty commits' '\n+\tmake_commit to_remove &&\n+\t(git rev-list HEAD | grep -v $(git rev-parse HEAD)) > expect &&\n+\tgit filter-branch -f --index-filter \"git update-index --remove to_remove\" --prune-empty HEAD &&\n+\tgit rev-list HEAD > actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.6.0.3.757.gf86e6.dirty\n"},{"id":"94478","messageId":"alpine.DEB.1.00.0810312334480.22125@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"16091","inReplyTo":"1225445204-28000-1-git-send-email-madcoder@debian.org","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-10-31T22:36:58Z","receivedAt":"2008-10-31T22:36:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 31 Oct 2008, Pierre Habouzit wrote:\n\n> git_commit_non_empty_tree is added to the functions that can be run from \n> commit filters. Its effect is to commit only commits actually touching \n> the tree and that are not merge points either.\n> \n> The option --prune-empty is added. It defaults the commit-filter to\n> 'git_commit_non_empty_tree \"$@\"', and can be used with any other\n> combination of filters, except --commit-hook that must used\n> 'git_commit_non_empty_tree \"$@\"' where one puts 'git commit-tree \"$@\"'\n> usually to achieve the same result.\n\nI think that the example Sverre posted is better.  It might be a bit more \nto write out, but at least people can adapt it to their needs (as opposed \nto only skip \"empty\" commits).\n\nHowever, I would _love_ to see your tests being merged with Sverre's patch \n(of course, the tests should use the described procedure, then).\n\nCiao,\nDscho\n"},{"id":"94481","messageId":"20081031224241.GD21799@artemis.corp","threadId":"16091","inReplyTo":"alpine.DEB.1.00.0810312334480.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-31T22:42:41Z","receivedAt":"2008-10-31T22:42:41Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, Oct 31, 2008 at 10:36:58PM +0000, Johannes Schindelin wrote:\n> Hi,\n> \n> On Fri, 31 Oct 2008, Pierre Habouzit wrote:\n> \n> > git_commit_non_empty_tree is added to the functions that can be run from \n> > commit filters. Its effect is to commit only commits actually touching \n> > the tree and that are not merge points either.\n> > \n> > The option --prune-empty is added. It defaults the commit-filter to\n> > 'git_commit_non_empty_tree \"$@\"', and can be used with any other\n> > combination of filters, except --commit-hook that must used\n> > 'git_commit_non_empty_tree \"$@\"' where one puts 'git commit-tree \"$@\"'\n> > usually to achieve the same result.\n> \n> I think that the example Sverre posted is better.  It might be a bit more \n> to write out, but at least people can adapt it to their needs (as opposed \n> to only skip \"empty\" commits).\n> \n> However, I would _love_ to see your tests being merged with Sverre's patch \n> (of course, the tests should use the described procedure, then).\n\nWell Sverre's example is probably the most efficient way to do the task,\nthough the thing is right now, what one wants is rarely to \"just\" skip\nempty commits, but to do some modifications that does not leave empty\ncommits.\n\nIOW not doing a modification _then_ a new one, but both at the same\ntime. Given how slow filter-branch can be, it's better to do one\ntransformation instead of two.\n\n\nNote that I don't think we should apply only my patch and not Sverre's,\nhis proposal just made me think that this was an itch I wanted to\nscratch for a long time, and both probably are complementary.\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"94714","messageId":"7viqr5wgl7.fsf@gitster.siamese.dyndns.org","threadId":"16091","inReplyTo":"1225445204-28000-1-git-send-email-madcoder@debian.org","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-03T04:58:44Z","receivedAt":"2008-11-03T04:58:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> +case \"$prune_empty,$filter_commit\" in\n> +',')\n> +\tfilter_commit='git commit-tree \"$@\"';;\n> +'t,')\n> +\tfilter_commit=\"$functions;\"' git_commit_non_empty_tree \"$@\"';;\n> +','*)\n> +\t;;\n> +*)\n> +\tdie \"Cannot set --prune-empty and --filter-commit at the same time\"\n> +esac\n\nThis is only style issue, but I find the above extremely difficult to\nread.  If it were either:\n\n\tcase ... in\n        ,) do \"neither set case\" ;;\n        t,) do \"prune but not filter case\" ;;\n        *) do \"both set case\" ;;\n        esac\n\nor (rather amateurish but conveys what it wants to do more clearly):\n        \n\tcase ... in\n        '','') do \"neither set case\" ;;\n        t,'') do \"prune but not filter case\" ;;\n        t,t) do \"both set case\" ;;\n        esac\n\nI wouldn't have to wonder which sq pairs with which one.\n\n> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> index b0a9d7d..352b56b 100755\n> --- a/t/t7003-filter-branch.sh\n> +++ b/t/t7003-filter-branch.sh\n> @@ -262,4 +262,12 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> +test_expect_success 'Prune empty commits' '\n> +\tmake_commit to_remove &&\n> +\t(git rev-list HEAD | grep -v $(git rev-parse HEAD)) > expect &&\n\nI am not sure what this one is doing.\n\n - Isn't this the same as \"git rev-list HEAD^\"?\n - Do you need a subshell?\n"},{"id":"94734","messageId":"20081103092729.GE13930@artemis.corp","threadId":"16091","inReplyTo":"7viqr5wgl7.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-11-03T09:27:29Z","receivedAt":"2008-11-03T09:27:29Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Mon, Nov 03, 2008 at 04:58:44AM +0000, Junio C Hamano wrote:\n> Pierre Habouzit <madcoder@debian.org> writes:\n> \n> > +case \"$prune_empty,$filter_commit\" in\n> > +',')\n> > +\tfilter_commit='git commit-tree \"$@\"';;\n> > +'t,')\n> > +\tfilter_commit=\"$functions;\"' git_commit_non_empty_tree \"$@\"';;\n> > +','*)\n> > +\t;;\n> > +*)\n> > +\tdie \"Cannot set --prune-empty and --filter-commit at the same time\"\n> > +esac\n> \n> This is only style issue, but I find the above extremely difficult to\n> read.  If it were either:\n> \n> \tcase ... in\n>         ,) do \"neither set case\" ;;\n>         t,) do \"prune but not filter case\" ;;\n>         *) do \"both set case\" ;;\n>         esac\n> \n> or (rather amateurish but conveys what it wants to do more clearly):\n>         \n> \tcase ... in\n>         '','') do \"neither set case\" ;;\n>         t,'') do \"prune but not filter case\" ;;\n>         t,t) do \"both set case\" ;;\n>         esac\n> \n> I wouldn't have to wonder which sq pairs with which one.\n\nagreed.\n\n> > diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> > index b0a9d7d..352b56b 100755\n> > --- a/t/t7003-filter-branch.sh\n> > +++ b/t/t7003-filter-branch.sh\n> > @@ -262,4 +262,12 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '\n> >  \ttest_cmp expect actual\n> >  '\n> >  \n> > +test_expect_success 'Prune empty commits' '\n> > +\tmake_commit to_remove &&\n> > +\t(git rev-list HEAD | grep -v $(git rev-parse HEAD)) > expect &&\n> \n> I am not sure what this one is doing.\n> \n>  - Isn't this the same as \"git rev-list HEAD^\"?\n>  - Do you need a subshell?\n\nThe filter-branch is supposed to prune the last commit done (current\nHEAD) from the revision list. So I build the rev-list we're supposed to\nhave in the end, and remove the matching ref from it. I don't see how to\navoid the subshell though, but if someone knows better please do :)\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"94768","messageId":"20081103151826.GJ13930@artemis.corp","threadId":"16091","inReplyTo":"20081103092729.GE13930@artemis.corp","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-11-03T15:18:26Z","receivedAt":"2008-11-03T15:18:26Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Mon, Nov 03, 2008 at 09:27:29AM +0000, Pierre Habouzit wrote:\n> On Mon, Nov 03, 2008 at 04:58:44AM +0000, Junio C Hamano wrote:\n> > > diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> > > index b0a9d7d..352b56b 100755\n> > > --- a/t/t7003-filter-branch.sh\n> > > +++ b/t/t7003-filter-branch.sh\n> > > @@ -262,4 +262,12 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '\n> > >  \ttest_cmp expect actual\n> > >  '\n> > >  \n> > > +test_expect_success 'Prune empty commits' '\n> > > +\tmake_commit to_remove &&\n> > > +\t(git rev-list HEAD | grep -v $(git rev-parse HEAD)) > expect &&\n> > \n> > I am not sure what this one is doing.\n> > \n> >  - Isn't this the same as \"git rev-list HEAD^\"?\n> >  - Do you need a subshell?\n> \n> The filter-branch is supposed to prune the last commit done (current\n> HEAD) from the revision list. So I build the rev-list we're supposed to\n> have in the end, and remove the matching ref from it. I don't see how to\n> avoid the subshell though, but if someone knows better please do :)\n\nActually one can write the test this way:\n\ntest_expect_success 'Prune empty commits' '\n       git rev-list HEAD > expect &&\n       make_commit to_remove &&\n       git filter-branch -f --index-filter \"git update-index --remove to_remove\" --prune-empty HEAD &&\n       git rev-list HEAD > actual &&\n       test_cmp expect actual\n'\n\nWhich basically:\n  - remembers the current list of revisions,\n  - makes a commit,\n  - runs an index-filter that makes that last commit void,\n  - checks the last commit has been removed.\n\nbelow is the updated patch with your comment and this fix\n---8<---\nFrom: Pierre Habouzit <madcoder@debian.org>\nDate: Fri, 31 Oct 2008 10:12:21 +0100\nSubject: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.\n\ngit_commit_non_empty_tree is added to the functions that can be run from\ncommit filters. Its effect is to commit only commits actually touching the\ntree and that are not merge points either.\n\nThe option --prune-empty is added. It defaults the commit-filter to\n'git_commit_non_empty_tree \"$@\"', and can be used with any other\ncombination of filters, except --commit-hook that must used\n'git_commit_non_empty_tree \"$@\"' where one puts 'git commit-tree \"$@\"'\nusually to achieve the same result.\n\nSigned-off-by: Pierre Habouzit <madcoder@debian.org>\n---\n Documentation/git-filter-branch.txt |   14 ++++++++++++++\n git-filter-branch.sh                |   29 ++++++++++++++++++++++++++++-\n t/t7003-filter-branch.sh            |    8 ++++++++\n 3 files changed, 50 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex fed6de6..451950b 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -122,6 +122,10 @@ You can use the 'map' convenience function in this filter, and other\n convenience functions, too.  For example, calling 'skip_commit \"$@\"'\n will leave out the current commit (but not its changes! If you want\n that, use 'git-rebase' instead).\n++\n+You can also use the 'git_commit_non_empty_tree \"$@\"' instead of\n+'git commit-tree \"$@\"' if you don't wish to keep commits with a single parent\n+and that makes no change to the tree.\n \n --tag-name-filter <command>::\n \tThis is the filter for rewriting tag names. When passed,\n@@ -151,6 +155,16 @@ to other tags will be rewritten to point to the underlying commit.\n \tThe result will contain that directory (and only that) as its\n \tproject root.\n \n+--prune-empty::\n+\tSome kind of filters will generate empty commits, that left the tree\n+\tuntouched.  This switch allow git-filter-branch to ignore such\n+\tcommits.  Though, this switch only applies for commits that have one\n+\tand only one parent, it will hence keep merges points. Also, this\n+\toption is not compatible with the use of '--commit-filter'. Though you\n+\tjust need to use the function 'git_commit_non_empty_tree \"$@\"' instead\n+\tof the 'git commit-tree \"$@\"' idiom in your commit filter to make that\n+\thappen.\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'.\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 81392ad..331724d 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -40,6 +40,16 @@ skip_commit()\n \tdone;\n }\n \n+# if you run 'git_commit_non_empty_tree \"$@\"' in a commit filter,\n+# it will skip commits that leave the tree untouched, commit the other.\n+git_commit_non_empty_tree()\n+{\n+\tif test $# = 3 && test \"$1\" = $(git rev-parse \"$3^{tree}\"); then\n+\t\tmap \"$3\"\n+\telse\n+\t\tgit commit-tree \"$@\"\n+\tfi\n+}\n # override die(): this version puts in an extra line break, so that\n # the progress is still visible\n \n@@ -109,11 +119,12 @@ filter_tree=\n filter_index=\n filter_parent=\n filter_msg=cat\n-filter_commit='git commit-tree \"$@\"'\n+filter_commit=\n filter_tag_name=\n filter_subdir=\n orig_namespace=refs/original/\n force=\n+prune_empty=\n while :\n do\n \tcase \"$1\" in\n@@ -126,6 +137,11 @@ do\n \t\tforce=t\n \t\tcontinue\n \t\t;;\n+\t--prune-empty)\n+\t\tshift\n+\t\tprune_empty=t\n+\t\tcontinue\n+\t\t;;\n \t-*)\n \t\t;;\n \t*)\n@@ -176,6 +192,17 @@ do\n \tesac\n done\n \n+case \"$prune_empty,$filter_commit\" in\n+,)\n+\tfilter_commit='git commit-tree \"$@\"';;\n+t,)\n+\tfilter_commit=\"$functions;\"' git_commit_non_empty_tree \"$@\"';;\n+,*)\n+\t;;\n+*)\n+\tdie \"Cannot set --prune-empty and --filter-commit at the same time\"\n+esac\n+\n case \"$force\" in\n t)\n \trm -rf \"$tempdir\"\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex b0a9d7d..8537bf9 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -262,4 +262,12 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'Prune empty commits' '\n+\tgit rev-list HEAD > expect &&\n+\tmake_commit to_remove &&\n+\tgit filter-branch -f --index-filter \"git update-index --remove to_remove\" --prune-empty HEAD &&\n+\tgit rev-list HEAD > actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.6.0.3.795.g892be\n\n"},{"id":"99811","messageId":"76718490901091129q534ca981iac54e0653d76170d@mail.gmail.com","threadId":"16091","inReplyTo":"20081103151826.GJ13930@artemis.corp","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-01-09T19:29:15Z","receivedAt":"2009-01-09T19:29:15Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Mon, Nov 3, 2008 at 10:18 AM, Pierre Habouzit <madcoder@debian.org> wrote:\n> On Mon, Nov 03, 2008 at 09:27:29AM +0000, Pierre Habouzit wrote:\n>> On Mon, Nov 03, 2008 at 04:58:44AM +0000, Junio C Hamano wrote:\n\nBump, http://thread.gmane.org/gmane.comp.version-control.git/99440/\n\n(I'd like to see this included. Having a bunch of empty commits after\nusing filter-branch to remove unwanted files from history is, er,\nsub-optimal, so seems like it might even be default behavior?)\n\nj.\n"},{"id":"99944","messageId":"20090111111800.GA8032@artemis.corp","threadId":"16091","inReplyTo":"76718490901091129q534ca981iac54e0653d76170d@mail.gmail.com","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2009-01-11T11:18:00Z","receivedAt":"2009-01-11T11:18:00Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, Jan 09, 2009 at 07:29:15PM +0000, Jay Soffian wrote:\n> On Mon, Nov 3, 2008 at 10:18 AM, Pierre Habouzit <madcoder@debian.org> wrote:\n> > On Mon, Nov 03, 2008 at 09:27:29AM +0000, Pierre Habouzit wrote:\n> >> On Mon, Nov 03, 2008 at 04:58:44AM +0000, Junio C Hamano wrote:\n> \n> Bump, http://thread.gmane.org/gmane.comp.version-control.git/99440/\n> \n> (I'd like to see this included. Having a bunch of empty commits after\n> using filter-branch to remove unwanted files from history is, er,\n> sub-optimal, so seems like it might even be default behavior?)\n\nYeah I have that in my own git tree, and I meant to ask if something had\nto be fixed for it to be accepted for some time, but always forget about\nit.\n\nJunio, do you think this could be accepted, or does it need some work ?\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"99959","messageId":"alpine.DEB.1.00.0901111433580.3586@pacific.mpi-cbg.de","threadId":"16091","inReplyTo":"20090111111800.GA8032@artemis.corp","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-11T13:35:15Z","receivedAt":"2009-01-11T13:35:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 11 Jan 2009, Pierre Habouzit wrote:\n\n> On Fri, Jan 09, 2009 at 07:29:15PM +0000, Jay Soffian wrote:\n> > On Mon, Nov 3, 2008 at 10:18 AM, Pierre Habouzit <madcoder@debian.org> wrote:\n> > > On Mon, Nov 03, 2008 at 09:27:29AM +0000, Pierre Habouzit wrote:\n> > >> On Mon, Nov 03, 2008 at 04:58:44AM +0000, Junio C Hamano wrote:\n> > \n> > Bump, http://thread.gmane.org/gmane.comp.version-control.git/99440/\n> > \n> > (I'd like to see this included. Having a bunch of empty commits after\n> > using filter-branch to remove unwanted files from history is, er,\n> > sub-optimal, so seems like it might even be default behavior?)\n> \n> Yeah I have that in my own git tree, and I meant to ask if something had \n> to be fixed for it to be accepted for some time, but always forget about \n> it.\n> \n> Junio, do you think this could be accepted, or does it need some work ?\n\nAFAICT Junio had some style issues which were not addressed.\n\nAnd I suggested to merge the tests with Sverre's patch.  That suggestion \nalso went unaddressed.\n\nCiao,\nDscho\n"},{"id":"99961","messageId":"20090111142732.GA18484@artemis.corp","threadId":"16091","inReplyTo":"alpine.DEB.1.00.0901111433580.3586@pacific.mpi-cbg.de","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2009-01-11T14:27:32Z","receivedAt":"2009-01-11T14:27:32Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Sun, Jan 11, 2009 at 01:35:15PM +0000, Johannes Schindelin wrote:\n> Hi,\n> \n> On Sun, 11 Jan 2009, Pierre Habouzit wrote:\n> \n> > On Fri, Jan 09, 2009 at 07:29:15PM +0000, Jay Soffian wrote:\n> > > On Mon, Nov 3, 2008 at 10:18 AM, Pierre Habouzit <madcoder@debian.org> wrote:\n> > > > On Mon, Nov 03, 2008 at 09:27:29AM +0000, Pierre Habouzit wrote:\n> > > >> On Mon, Nov 03, 2008 at 04:58:44AM +0000, Junio C Hamano wrote:\n> > > \n> > > Bump, http://thread.gmane.org/gmane.comp.version-control.git/99440/\n> > > \n> > > (I'd like to see this included. Having a bunch of empty commits after\n> > > using filter-branch to remove unwanted files from history is, er,\n> > > sub-optimal, so seems like it might even be default behavior?)\n> > \n> > Yeah I have that in my own git tree, and I meant to ask if something had \n> > to be fixed for it to be accepted for some time, but always forget about \n> > it.\n> > \n> > Junio, do you think this could be accepted, or does it need some work ?\n> \n> AFAICT Junio had some style issues which were not addressed.\n\nHuh, I did in a latter resend in that very thread.\n\n> And I suggested to merge the tests with Sverre's patch.  That suggestion \n> also went unaddressed.\n\nI can't find any mails from Sverre in the same thread, but maybe I'm not\nsearching in the proper place...\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"99963","messageId":"bd6139dc0901110640l148b00dctd667572e28908f9f@mail.gmail.com","threadId":"16091","inReplyTo":"20090111142732.GA18484@artemis.corp","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-01-11T14:40:04Z","receivedAt":"2009-01-11T14:40:04Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"On Sun, Jan 11, 2009 at 15:27, Pierre Habouzit <madcoder@debian.org> wrote:\n>> And I suggested to merge the tests with Sverre's patch.  That suggestion\n>> also went unaddressed.\n>\n> I can't find any mails from Sverre in the same thread, but maybe I'm not\n> searching in the proper place...\n\nI think my patch is in a different thread as it was a\ndocumentation-only patch, no?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"99964","messageId":"20090111145537.GB18484@artemis.corp","threadId":"16091","inReplyTo":"bd6139dc0901110640l148b00dctd667572e28908f9f@mail.gmail.com","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2009-01-11T14:55:37Z","receivedAt":"2009-01-11T14:55:37Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Sun, Jan 11, 2009 at 02:40:04PM +0000, Sverre Rabbelier wrote:\n> On Sun, Jan 11, 2009 at 15:27, Pierre Habouzit <madcoder@debian.org> wrote:\n> >> And I suggested to merge the tests with Sverre's patch.  That suggestion\n> >> also went unaddressed.\n> >\n> > I can't find any mails from Sverre in the same thread, but maybe I'm not\n> > searching in the proper place...\n> \n> I think my patch is in a different thread as it was a\n> documentation-only patch, no?\n\nNo I've found it, it was sent by Petr which explains why I didn't find a\nmail from _you_ :P\n\nWill sent a patch reworked to have a special paragraph the way you\nwanted, but using my additions instead.\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"99967","messageId":"bd6139dc0901110708u15814e4bl5a3149e68355901f@mail.gmail.com","threadId":"16091","inReplyTo":"20090111145537.GB18484@artemis.corp","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-01-11T15:08:33Z","receivedAt":"2009-01-11T15:08:33Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"On Sun, Jan 11, 2009 at 15:55, Pierre Habouzit <madcoder@debian.org> wrote:\n> No I've found it, it was sent by Petr which explains why I didn't find a\n> mail from _you_ :P\n\nAh, yes, that's right :).\n\n> Will sent a patch reworked to have a special paragraph the way you\n> wanted, but using my additions instead.\n\nOk, nice!\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"100004","messageId":"7vab9xsgzf.fsf@gitster.siamese.dyndns.org","threadId":"16091","inReplyTo":"20090111142732.GA18484@artemis.corp","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-11T20:52:20Z","receivedAt":"2009-01-11T20:52:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre Habouzit <madcoder@debian.org> writes:\n\n> On Sun, Jan 11, 2009 at 01:35:15PM +0000, Johannes Schindelin wrote:\n> ...\n>> And I suggested to merge the tests with Sverre's patch.  That suggestion \n>> also went unaddressed.\n>\n> I can't find any mails from Sverre in the same thread, but maybe I'm not\n> searching in the proper place...\n\nThis is in 'master' already; if there was anything missing in your patch,\nplease fill in with updates.\n"},{"id":"100006","messageId":"alpine.DEB.1.00.0901112154410.3586@pacific.mpi-cbg.de","threadId":"16091","inReplyTo":"7vab9xsgzf.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] filter-branch: add git_commit_non_empty_tree and --prune-empty.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-11T20:55:21Z","receivedAt":"2009-01-11T20:55:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 11 Jan 2009, Junio C Hamano wrote:\n\n> Pierre Habouzit <madcoder@debian.org> writes:\n> \n> > On Sun, Jan 11, 2009 at 01:35:15PM +0000, Johannes Schindelin wrote:\n> > ...\n> >> And I suggested to merge the tests with Sverre's patch.  That \n> >> suggestion also went unaddressed.\n> >\n> > I can't find any mails from Sverre in the same thread, but maybe I'm \n> > not searching in the proper place...\n> \n> This is in 'master' already; if there was anything missing in your \n> patch, please fill in with updates.\n\nI _think_ that I asked for test cases to use that workflow, so that we can \nbe sure that what's in the man page actually works.\n\nCiao,\nDscho\n"}]}