{"thread":{"id":"11802","subject":"[PATCH] filter-branch: assume HEAD if no revision supplied","startedAt":"2008-01-30T19:33:04Z","lastAt":"2008-01-31T21:53:14Z","messageCount":21,"participants":["Brandon Casey","Johannes Schindelin","Junio C Hamano","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"66919","messageId":"47A0D0F0.1020800@nrlssc.navy.mil","threadId":"11802","inReplyTo":null,"subject":"[PATCH] filter-branch: assume HEAD if no revision supplied","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-30T19:33:04Z","receivedAt":"2008-01-30T19:33:04Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"filter-branch previously took the first non-option argument as the name for\na new branch. Since dfd05e38, it now takes a revision or a revision range\nand modifies the current branch. Update to operate on HEAD by default to\nconform with standard git interface practice.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nYou may think that filter-branch _should_ require the user to specify the\nrevision. If so, then '--default HEAD' should probably be removed from the\nother two places, and the usage and documentation should be updated to\nremove the brackets around <rev-list options> so not to imply that it is\noptional. The test for at least one non-option argument can still be\nremoved since it can currently be circumvented by placing -- as the\nlast argument and because it would allow format-patch to fail with\na much nicer message: \"Which ref do you want to rewrite?\".\n\nfwiw the behavior this patch implements is what I expected.\n\n-brandon\n\n\n git-filter-branch.sh |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex ebf05ca..cd1eeee 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -114,7 +114,6 @@ orig_namespace=refs/original/\n force=\n while :\n do\n-\ttest $# = 0 && usage\n \tcase \"$1\" in\n \t--)\n \t\tshift\n@@ -210,7 +209,7 @@ GIT_WORK_TREE=.\n export GIT_DIR GIT_WORK_TREE\n \n # The refs should be updated if their heads were rewritten\n-git rev-parse --no-flags --revs-only --symbolic-full-name \"$@\" |\n+git rev-parse --no-flags --revs-only --symbolic-full-name --default HEAD \"$@\" |\n sed -e '/^^/d' >\"$tempdir\"/heads\n \n test -s \"$tempdir\"/heads ||\n-- \n1.5.4.rc5.14.gaa8fc\n"},{"id":"66922","messageId":"alpine.LSU.1.00.0801302034310.23907@racer.site","threadId":"11802","inReplyTo":"47A0D0F0.1020800@nrlssc.navy.mil","subject":"Re: [PATCH] filter-branch: assume HEAD if no revision supplied","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-30T20:35:00Z","receivedAt":"2008-01-30T20:35:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 30 Jan 2008, Brandon Casey wrote:\n\n> filter-branch previously took the first non-option argument as the name \n> for a new branch. Since dfd05e38, it now takes a revision or a revision \n> range and modifies the current branch. Update to operate on HEAD by \n> default to conform with standard git interface practice.\n\nFWIW I think the code wanted to let \"git filter-branch\" without options \nprint the usage.\n\nCiao,\nDscho\n"},{"id":"66926","messageId":"7vk5lrgh56.fsf@gitster.siamese.dyndns.org","threadId":"11802","inReplyTo":"alpine.LSU.1.00.0801302034310.23907@racer.site","subject":"Re: [PATCH] filter-branch: assume HEAD if no revision supplied","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-30T21:03:49Z","receivedAt":"2008-01-30T21:03:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Wed, 30 Jan 2008, Brandon Casey wrote:\n>\n>> filter-branch previously took the first non-option argument as the name \n>> for a new branch. Since dfd05e38, it now takes a revision or a revision \n>> range and modifies the current branch. Update to operate on HEAD by \n>> default to conform with standard git interface practice.\n>\n> FWIW I think the code wanted to let \"git filter-branch\" without options \n> print the usage.\n\nThat might be a valid safety concern to some folks.  Previously\nwe have seen people say \"Whenever I see a command foo that I do\nnot know what it does, I type 'foo <Enter>' and expect it gives\nthe usage back.  So any new destructive command 'foo' should not\ndo a damage by using built-in default.\" (I think it was about\n\"git stash\" without parameter).\n\nBy the way, I do not personally think it is worth to be heavily\nsupportive to the practice of trying an unknown command without\nunderstanding, and I do not agree such a safety is necessarily a\ngood idea, especially if it makes normal use of the command more\ncumbersome by people who understand what it does.\n\nEven though \"git stash\" itself is not destrictive, you need to\nknow its \"apply\" subcommand to undo the action.  In that sense,\nit is destructive to clueless people who blindly type whatever\ncommand they see.\n\nThat's why we still allow you to say \"git stash\", but we removed\nits \"git stash <randam message>\" syntax, which was risky when\nsubcommand name was misspelled even by people who know what the\ncommand does.  I think we struck a good balance between\nusability and safety there.  And I think we can do the same\nhere.\n\nPerhaps \"git filter-branch <Enter>\" can be prevented as in the\ncurrent implementation while \"git filter-branch --foo-filter\nfoo\" can default to HEAD to satisfy both needs.  The command\nwithout any filter is supposed to be mostly no-op (unless you\nare trying to rewrite the history with grafts).\n"},{"id":"66934","messageId":"47A109A7.1070502@nrlssc.navy.mil","threadId":"11802","inReplyTo":"7vk5lrgh56.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] filter-branch: assume HEAD if no revision supplied","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-30T23:35:03Z","receivedAt":"2008-01-30T23:35:03Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n>> On Wed, 30 Jan 2008, Brandon Casey wrote:\n>>\n>>> filter-branch previously took the first non-option argument as the name \n>>> for a new branch. Since dfd05e38, it now takes a revision or a revision \n>>> range and modifies the current branch. Update to operate on HEAD by \n>>> default to conform with standard git interface practice.\n>> FWIW I think the code wanted to let \"git filter-branch\" without options \n>> print the usage.\n> \n> That might be a valid safety concern to some folks.  Previously\n> we have seen people say \"Whenever I see a command foo that I do\n> not know what it does, I type 'foo <Enter>' and expect it gives\n> the usage back.  So any new destructive command 'foo' should not\n> do a damage by using built-in default.\" (I think it was about\n> \"git stash\" without parameter).\n> \n> By the way, I do not personally think it is worth to be heavily\n> supportive to the practice of trying an unknown command without\n> understanding, and I do not agree such a safety is necessarily a\n> good idea, especially if it makes normal use of the command more\n> cumbersome by people who understand what it does.\n> \n> Even though \"git stash\" itself is not destrictive, you need to\n> know its \"apply\" subcommand to undo the action.  In that sense,\n> it is destructive to clueless people who blindly type whatever\n> command they see.\n> \n> That's why we still allow you to say \"git stash\", but we removed\n> its \"git stash <randam message>\" syntax, which was risky when\n> subcommand name was misspelled even by people who know what the\n> command does.  I think we struck a good balance between\n> usability and safety there.  And I think we can do the same\n> here.\n>\n> Perhaps \"git filter-branch <Enter>\" can be prevented as in the\n> current implementation while \"git filter-branch --foo-filter\n> foo\" can default to HEAD to satisfy both needs.  The command\n> without any filter is supposed to be mostly no-op (unless you\n> are trying to rewrite the history with grafts).\n\nThat's what I was trying to do :)\n\nThe goal should be consistency in the user interface. New users will\nalways get confused. Lack of consistency could cause confusion for\nexperienced users. I sent a patch because it was intuitive to me for\nfilter-branch to operate on HEAD based on my git experience, and I was\nsurprised when it did not. For porcelain that take a revision argument\nit seems common to default to HEAD.\n\nI think the stash case is a little bit different because it was\nactually causing problems for experienced users. A minor typo would\nbite experienced people from time to time.\n\nIn that same consistency vein, I wonder if a user would be surprised\nthat 'git filter-branch' prints usage information but 'git filter-branch --'\noperates on HEAD? Maybe the following patch would be better than the\ncompromise solution. (following in another email)\n\n-brandon\n\nPS. Please s/format-patch/filter-branch/ if I missed any. I keep\ndoing that.\n"},{"id":"66935","messageId":"47A112C5.8010903@nrlssc.navy.mil","threadId":"11802","inReplyTo":"47A109A7.1070502@nrlssc.navy.mil","subject":"[PATCH 1/2] filter-branch: only print usage information when no arguments supplied","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-31T00:13:57Z","receivedAt":"2008-01-31T00:13:57Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Testing for whether command line arguments were supplied was being\nperformed during option parsing. This had the side effect of\nprinting usage information when a more appropriate error message\nwould have been printed had the script been allowed to continue.\n\nNow this:\n\n\tgit filter-branch\n\nwill print usage information.\n\nAnd these:\n\n\tgit filter-branch -d /tmp/work-dir\n\tgit filter-branch <non-existant-revision>\n\tgit filter-branch --\n\tgit filter-branch -- <non-existant-revision>\n\nwill print a message informing the user that filter-branch did\nnot know which reference to rewrite. Without this patch the\none with '-d' would also print usage information.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nI prefer my original patch since I think it is consistent\nwith the git interface.\n\n-brandon\n\n\n git-filter-branch.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex ebf05ca..5e3fe70 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -97,6 +97,8 @@ USAGE=\"[--env-filter <command>] [--tree-filter <command>] \\\n OPTIONS_SPEC=\n . git-sh-setup\n \n+test $# = 0 && usage\n+\n git diff-files --quiet &&\n \tgit diff-index --cached --quiet HEAD -- ||\n \tdie \"Cannot rewrite branch(es) with a dirty working directory.\"\n@@ -114,7 +116,6 @@ orig_namespace=refs/original/\n force=\n while :\n do\n-\ttest $# = 0 && usage\n \tcase \"$1\" in\n \t--)\n \t\tshift\n-- \n1.5.4.rc5.14.gaa8fc\n"},{"id":"66936","messageId":"47A11317.2010409@nrlssc.navy.mil","threadId":"11802","inReplyTo":"1201738186-28132-1-git-send-email-casey@nrlssc.navy.mil","subject":"[PATCH 2/2] git-filter-branch.sh: don't use --default when calling rev-list","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-31T00:15:19Z","receivedAt":"2008-01-31T00:15:19Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"This command requires a revision to be specified on the command line,\nso remove '--default HEAD' from the arguments to git rev-list. They\nare unnecessary.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n git-filter-branch.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 5e3fe70..25f18f8 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -228,11 +228,10 @@ mkdir ../map || die \"Could not create map/ directory\"\n \n case \"$filter_subdir\" in\n \"\")\n-\tgit rev-list --reverse --topo-order --default HEAD \\\n-\t\t--parents \"$@\"\n+\tgit rev-list --reverse --topo-order --parents \"$@\"\n \t;;\n *)\n-\tgit rev-list --reverse --topo-order --default HEAD \\\n+\tgit rev-list --reverse --topo-order \\\n \t\t--parents --full-history \"$@\" -- \"$filter_subdir\"\n esac > ../revs || die \"Could not get the commits\"\n commits=$(wc -l <../revs | tr -d \" \")\n-- \n1.5.4.rc5.14.gaa8fc\n"},{"id":"66937","messageId":"alpine.LSU.1.00.0801310013010.23907@racer.site","threadId":"11802","inReplyTo":"47A109A7.1070502@nrlssc.navy.mil","subject":"Re: [PATCH] filter-branch: assume HEAD if no revision supplied","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-31T00:16:41Z","receivedAt":"2008-01-31T00:16:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 30 Jan 2008, Brandon Casey wrote:\n\n> Junio C Hamano wrote:\n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > \n> >> On Wed, 30 Jan 2008, Brandon Casey wrote:\n> >>\n> >>> filter-branch previously took the first non-option argument as the name \n> >>> for a new branch. Since dfd05e38, it now takes a revision or a revision \n> >>> range and modifies the current branch. Update to operate on HEAD by \n> >>> default to conform with standard git interface practice.\n> >> FWIW I think the code wanted to let \"git filter-branch\" without options \n> >> print the usage.\n> > \n> > That might be a valid safety concern to some folks.  Previously\n> > we have seen people say \"Whenever I see a command foo that I do\n> > not know what it does, I type 'foo <Enter>' and expect it gives\n> > the usage back.  So any new destructive command 'foo' should not\n> > do a damage by using built-in default.\" (I think it was about\n> > \"git stash\" without parameter).\n> > \n> > By the way, I do not personally think it is worth to be heavily\n> > supportive to the practice of trying an unknown command without\n> > understanding, and I do not agree such a safety is necessarily a\n> > good idea, especially if it makes normal use of the command more\n> > cumbersome by people who understand what it does.\n> > \n> > Even though \"git stash\" itself is not destrictive, you need to\n> > know its \"apply\" subcommand to undo the action.  In that sense,\n> > it is destructive to clueless people who blindly type whatever\n> > command they see.\n> > \n> > That's why we still allow you to say \"git stash\", but we removed\n> > its \"git stash <randam message>\" syntax, which was risky when\n> > subcommand name was misspelled even by people who know what the\n> > command does.  I think we struck a good balance between\n> > usability and safety there.  And I think we can do the same\n> > here.\n> >\n> > Perhaps \"git filter-branch <Enter>\" can be prevented as in the\n> > current implementation while \"git filter-branch --foo-filter\n> > foo\" can default to HEAD to satisfy both needs.  The command\n> > without any filter is supposed to be mostly no-op (unless you\n> > are trying to rewrite the history with grafts).\n> \n> That's what I was trying to do :)\n\nBut then you would have to keep the test for $#, but enhance it like this:\n\ncase \"$#,$filter_env,$filter_tree,$filter_index,$filter_parent,\\\n$filter_msg,$filter_commit,$filter_tag_name,$filter_subdir\" in\n0,,,,,cat,'git commit-tree \"$@\"',)\n\tusage\nesac\n\nYes, it's ugly.\n\nAnother method would be having the test _before_ the while loop. ;-)\n\nCiao,\nDscho\n"},{"id":"66938","messageId":"47A1146B.5040601@nrlssc.navy.mil","threadId":"11802","inReplyTo":"alpine.LSU.1.00.0801310013010.23907@racer.site","subject":"Re: [PATCH] filter-branch: assume HEAD if no revision supplied","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-31T00:20:59Z","receivedAt":"2008-01-31T00:20:59Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 30 Jan 2008, Brandon Casey wrote:\n> \n>> Junio C Hamano wrote:\n\n<snip>\n>>> (unless you are trying to rewrite the history with grafts).\n>> That's what I was trying to do :)\n> \n> But then you would have to keep the test for $#, but enhance it like this:\n> \n> case \"$#,$filter_env,$filter_tree,$filter_index,$filter_parent,\\\n> $filter_msg,$filter_commit,$filter_tag_name,$filter_subdir\" in\n> 0,,,,,cat,'git commit-tree \"$@\"',)\n> \tusage\n> esac\n\nI meant I was trying to rewrite the history with grafts. :)\n\n-brandon\n"},{"id":"66939","messageId":"47A11935.6000707@nrlssc.navy.mil","threadId":"11802","inReplyTo":"47A109A7.1070502@nrlssc.navy.mil","subject":"[PATCH] filter-branch docs: remove brackets so not to imply revision arg is optional","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-31T00:41:25Z","receivedAt":"2008-01-31T00:41:25Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n Documentation/git-filter-branch.txt |    2 +-\n git-filter-branch.sh                |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex e22dfa5..6145322 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -13,7 +13,7 @@ SYNOPSIS\n \t[--msg-filter <command>] [--commit-filter <command>]\n \t[--tag-name-filter <command>] [--subdirectory-filter <directory>]\n \t[--original <namespace>] [-d <directory>] [-f | --force]\n-\t[<rev-list options>...]\n+\t<rev-list options>\n \n DESCRIPTION\n -----------\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 25f18f8..7f71523 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -92,7 +92,7 @@ USAGE=\"[--env-filter <command>] [--tree-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+<rev-list options>\"\n \n OPTIONS_SPEC=\n . git-sh-setup\n-- \n1.5.4.rc5.14.gaa8fc\n"},{"id":"66940","messageId":"alpine.LSU.1.00.0801310048350.23907@racer.site","threadId":"11802","inReplyTo":"47A11317.2010409@nrlssc.navy.mil","subject":"Re: [PATCH 2/2] git-filter-branch.sh: don't use --default when calling rev-list","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-31T00:49:06Z","receivedAt":"2008-01-31T00:49:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 30 Jan 2008, Brandon Casey wrote:\n\n> This command requires a revision to be specified on the command line, so \n> remove '--default HEAD' from the arguments to git rev-list. They are \n> unnecessary.\n\nBut I thought that you wanted \"git filter-branch --msg-filter=rot13\" to \nwork on HEAD by default?\n\nCiao,\nDscho\n"},{"id":"66943","messageId":"7v7ihqhjq9.fsf@gitster.siamese.dyndns.org","threadId":"11802","inReplyTo":"47A11935.6000707@nrlssc.navy.mil","subject":"Re: [PATCH] filter-branch docs: remove brackets so not to imply revision arg is optional","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-31T01:22:38Z","receivedAt":"2008-01-31T01:22:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I think this is good for 1.5.4.  I am not sure about the\n\"assuming HEAD\" one.  Personally I am not very fond of the\nidiot-proofing, but there may be many idiots around here, so...\n"},{"id":"66944","messageId":"7v3asehj5s.fsf@gitster.siamese.dyndns.org","threadId":"11802","inReplyTo":"47A112C5.8010903@nrlssc.navy.mil","subject":"Re: [PATCH 1/2] filter-branch: only print usage information when no arguments supplied","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-31T01:34:55Z","receivedAt":"2008-01-31T01:34:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> Testing for whether command line arguments were supplied was being\n> performed during option parsing. This had the side effect of\n> printing usage information when a more appropriate error message\n> would have been printed had the script been allowed to continue.\n>\n> Now this:\n>\n> \tgit filter-branch\n>\n> will print usage information.\n>\n> And these:\n>\n> \tgit filter-branch -d /tmp/work-dir\n> \tgit filter-branch <non-existant-revision>\n> \tgit filter-branch --\n> \tgit filter-branch -- <non-existant-revision>\n>\n> will print a message informing the user that filter-branch did\n> not know which reference to rewrite. Without this patch the\n> one with '-d' would also print usage information.\n>\n> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n> ---\n>\n>\n> I prefer my original patch since I think it is consistent\n> with the git interface.\n\nI'd refrain from commenting on if it is consistent or not with\n\"the git interface\".\n\nBut I would say I prefer your original better than this one.\nWill apply.\n"},{"id":"66945","messageId":"47A125D9.2070105@nrlssc.navy.mil","threadId":"11802","inReplyTo":"alpine.LSU.1.00.0801310048350.23907@racer.site","subject":"Re: [PATCH 2/2] git-filter-branch.sh: don't use --default when calling rev-list","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-31T01:35:21Z","receivedAt":"2008-01-31T01:35:21Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 30 Jan 2008, Brandon Casey wrote:\n> \n>> This command requires a revision to be specified on the command line, so \n>> remove '--default HEAD' from the arguments to git rev-list. They are \n>> unnecessary.\n> \n> But I thought that you wanted \"git filter-branch --msg-filter=rot13\" to \n> work on HEAD by default?\n\nI do. But isn't that inconsistent with \"git filter-branch\" does _not_ work\non HEAD by default and instead prints out usage information?\n\nIf I do:\n\n\tgit filter-branch -d /tmp/git_temp\n\nand it is successful, I think I would also expect this to succeed:\n\n\tgit filter-branch\n\nSo, I think the \"operates on HEAD\" by default is consistent with what other\ngit tools do, but I think it is not consistent for filter-branch to sometimes\noperate on HEAD by default and sometimes error with usage information.\n\nDisclaimer: I have only used filter-branch for two tasks.\n\n-brandon\n"},{"id":"66946","messageId":"alpine.LSU.1.00.0801310153280.23907@racer.site","threadId":"11802","inReplyTo":"7v7ihqhjq9.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] filter-branch docs: remove brackets so not to imply revision arg is optional","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-31T01:53:47Z","receivedAt":"2008-01-31T01:53:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 30 Jan 2008, Junio C Hamano wrote:\n\n> I think this is good for 1.5.4.  I am not sure about the \"assuming HEAD\" \n> one.  Personally I am not very fond of the idiot-proofing, but there may \n> be many idiots around here, so...\n\nOh yes, oh yes.  Count me in!\n\n;-)\n\nCiao,\nDscho\n"},{"id":"66947","messageId":"47A12CF1.1010801@nrlssc.navy.mil","threadId":"11802","inReplyTo":"7v3asehj5s.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/2] filter-branch: only print usage information when no arguments supplied","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-31T02:05:37Z","receivedAt":"2008-01-31T02:05:37Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> Brandon Casey <casey@nrlssc.navy.mil> writes:\n>>\n>> I prefer my original patch since I think it is consistent\n>> with the git interface.\n> \n> I'd refrain from commenting on if it is consistent or not with\n> \"the git interface\".\n\nI'm not sure whether you're saying that _I_ should refrain from\nmaking comments about \"git interface\" consistencies? If that's\nthe case, I hope you see I stated it as an opinion by saying\n\"I think\" and I don't presume to have contributed anything but\na few minor patches. If I would have thought about it for more\nthan a split second I would have said \"...since I think it is\nmore consistent with what other git tools do.\"\n\nor whether you're just saying git is still in flux and there is\nno \"git interface\"...\n\n-brandon\n"},{"id":"66950","messageId":"7vwspqg1dv.fsf@gitster.siamese.dyndns.org","threadId":"11802","inReplyTo":"47A12CF1.1010801@nrlssc.navy.mil","subject":"Re: [PATCH 1/2] filter-branch: only print usage information when no arguments supplied","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-31T02:44:12Z","receivedAt":"2008-01-31T02:44:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> Junio C Hamano wrote:\n>> Brandon Casey <casey@nrlssc.navy.mil> writes:\n>>>\n>>> I prefer my original patch since I think it is consistent\n>>> with the git interface.\n>> \n>> I'd refrain from commenting on if it is consistent or not with\n>> \"the git interface\".\n>\n> I'm not sure whether you're saying that _I_ should refrain from\n> making comments about \"git interface\" consistencies?\n\nNo, I am just saying \"I (Junio) is stupid and lazy, and I do not\nwant to think about it right now, so I will not judge on that\npoint\".\n"},{"id":"66966","messageId":"47A19211.5090409@op5.se","threadId":"11802","inReplyTo":"47A125D9.2070105@nrlssc.navy.mil","subject":"Re: [PATCH 2/2] git-filter-branch.sh: don't use --default when calling rev-list","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-01-31T09:17:05Z","receivedAt":"2008-01-31T09:17:05Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Brandon Casey wrote:\n> Johannes Schindelin wrote:\n>> Hi,\n>>\n>> On Wed, 30 Jan 2008, Brandon Casey wrote:\n>>\n>>> This command requires a revision to be specified on the command line, so \n>>> remove '--default HEAD' from the arguments to git rev-list. They are \n>>> unnecessary.\n>> But I thought that you wanted \"git filter-branch --msg-filter=rot13\" to \n>> work on HEAD by default?\n> \n> I do. But isn't that inconsistent with \"git filter-branch\" does _not_ work\n> on HEAD by default and instead prints out usage information?\n> \n> If I do:\n> \n> \tgit filter-branch -d /tmp/git_temp\n> \n> and it is successful, I think I would also expect this to succeed:\n> \n> \tgit filter-branch\n> \n> So, I think the \"operates on HEAD\" by default is consistent with what other\n> git tools do, but I think it is not consistent for filter-branch to sometimes\n> operate on HEAD by default and sometimes error with usage information.\n> \n\nWell, if there's no filter specified it has nothing to do, so erroring out\nin the no-arguments-at-all case would be sensible.\n\nOTOH, it would be better to error out for the no-filter case explicitly,\nwhich would also cause the no-arguments case to error out.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"66969","messageId":"7vwspqcple.fsf@gitster.siamese.dyndns.org","threadId":"11802","inReplyTo":"47A19211.5090409@op5.se","subject":"Re: [PATCH 2/2] git-filter-branch.sh: don't use --default when calling rev-list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-31T09:27:09Z","receivedAt":"2008-01-31T09:27:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Ericsson <ae@op5.se> writes:\n\n> Well, if there's no filter specified it has nothing to do, so erroring out\n> in the no-arguments-at-all case would be sensible.\n\nActually, not erroring out but just returning doing nothing (if\nthere truly isn't anything to do -- iow, the filtering operation\nturns out to be identity function) would be more sensible.\n\nNo filter does not necessarily mean identity, by the way.  Think\n\"grafts\" ;-).\n"},{"id":"66983","messageId":"alpine.LSU.1.00.0801311106300.23907@racer.site","threadId":"11802","inReplyTo":"7vwspqcple.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/2] git-filter-branch.sh: don't use --default when calling rev-list","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-31T11:07:06Z","receivedAt":"2008-01-31T11:07:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 31 Jan 2008, Junio C Hamano wrote:\n\n> Andreas Ericsson <ae@op5.se> writes:\n> \n> > Well, if there's no filter specified it has nothing to do, so erroring \n> > out in the no-arguments-at-all case would be sensible.\n> \n> Actually, not erroring out but just returning doing nothing (if there \n> truly isn't anything to do -- iow, the filtering operation turns out to \n> be identity function) would be more sensible.\n> \n> No filter does not necessarily mean identity, by the way.  Think \n> \"grafts\" ;-).\n\nYeah.  Having slept over it, I agree that there is a sensible default \naction, and only one.\n\nCiao,\nDscho\n"},{"id":"66989","messageId":"47A1F784.3080202@nrlssc.navy.mil","threadId":"11802","inReplyTo":"7v7ihqhjq9.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] filter-branch docs: remove brackets so not to imply revision arg is optional","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-01-31T16:29:56Z","receivedAt":"2008-01-31T16:29:56Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Junio C Hamano wrote:\n> I think this is good for 1.5.4.  I am not sure about the\n> \"assuming HEAD\" one.  Personally I am not very fond of the\n> idiot-proofing, but there may be many idiots around here, so...\n\n\nI see you applied both this patch _and_\n\"filter-branch: assume HEAD if no revision supplied\"\n\nThe latter patch _does_ make the revision arg optional, so this\n\"filter-branch docs\" patch is unnecessary.\n\n-brandon\n"},{"id":"66995","messageId":"7vmyqlbr1x.fsf@gitster.siamese.dyndns.org","threadId":"11802","inReplyTo":"47A1F784.3080202@nrlssc.navy.mil","subject":"Re: [PATCH] filter-branch docs: remove brackets so not to imply revision arg is optional","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-31T21:53:14Z","receivedAt":"2008-01-31T21:53:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> The latter patch _does_ make the revision arg optional, so this\n> \"filter-branch docs\" patch is unnecessary.\n\nYou are of course right.  I changed my mind and forgot to revert\nthat one.\n\nHere is what I'll do.\n\n[PATCH] Revert \"filter-branch docs: remove brackets so not to imply revision arg is optional\"\n\nThis reverts commit c41b439244c51b30c60953192816afc91e552578, as\nwe decided to default to HEAD when revision parameters are missing\nand they are no longer mandatory.\n\n Documentation/git-filter-branch.txt |    2 +-\n git-filter-branch.sh                |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n-- \n1.5.4.rc5.16.gc0279\n"}]}