{"thread":{"id":"18100","subject":"[PATCH] git filter-branch: Process commits in --date-order","startedAt":"2009-03-02T23:10:54Z","lastAt":"2009-03-03T07:41:46Z","messageCount":5,"participants":["Peter Rosin","Johannes Schindelin","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"106744","messageId":"1236035454-12236-1-git-send-email-peda@lysator.liu.se","threadId":"18100","inReplyTo":null,"subject":"[PATCH] git filter-branch: Process commits in --date-order","fromName":"Peter Rosin","fromEmail":"peda@lysator.liu.se","sentAt":"2009-03-02T23:10:54Z","receivedAt":"2009-03-02T23:10:54Z","isPatch":true,"sender":{"key":"peda@lysator.liu.se","avatar":null},"body":"When converting an svn repository to git, I am filtering the commits\nusing --msg-filter. During this conversion I want to use the\n.git-rewrite/map data to fill in references to other commits. In the\nsvn repo, there is a commit message e.g. \"Cherry-pick r207\", and I\nwant to append \"r207 = <commit>\" to the git commit message, as r207\nno longer means very much. This works fine when the git commit\ncorresponding to r207 has been filtered before the current commit, and\nis present in the map. When filtering in --topo-order, this is not\nalways the case, making it impossible to look up the git commit.\n\nSigned-off-by: Peter Rosin <peda@lysator.liu.se>\n---\n git-filter-branch.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 9a09ba1..dbb2bb3 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -257,11 +257,11 @@ 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+\tgit rev-list --reverse --date-order --default HEAD \\\n \t\t--parents --simplify-merges \"$@\"\n \t;;\n *)\n-\tgit rev-list --reverse --topo-order --default HEAD \\\n+\tgit rev-list --reverse --date-order --default HEAD \\\n \t\t--parents --simplify-merges \"$@\" -- \"$filter_subdir\"\n esac > ../revs || die \"Could not get the commits\"\n commits=$(wc -l <../revs | tr -d \" \")\n-- \n1.6.0.4\n"},{"id":"106745","messageId":"alpine.DEB.1.00.0903030126530.10279@pacific.mpi-cbg.de","threadId":"18100","inReplyTo":"1236035454-12236-1-git-send-email-peda@lysator.liu.se","subject":"Re: [PATCH] git filter-branch: Process commits in --date-order","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-03T00:28:10Z","receivedAt":"2009-03-03T00:28:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 3 Mar 2009, Peter Rosin wrote:\n\n> When converting an svn repository to git, I am filtering the commits\n> using --msg-filter. During this conversion I want to use the\n> .git-rewrite/map data to fill in references to other commits. In the\n> svn repo, there is a commit message e.g. \"Cherry-pick r207\", and I\n> want to append \"r207 = <commit>\" to the git commit message, as r207\n> no longer means very much. This works fine when the git commit\n> corresponding to r207 has been filtered before the current commit, and\n> is present in the map. When filtering in --topo-order, this is not\n> always the case, making it impossible to look up the git commit.\n\nI'd rather have this as an option.  God knows what breaks with time-skewed \nrepositories if you use date-order instead of topo-order, and I'd rather \nnot break that not quite uncommon case.\n\nCiao,\nDscho\n"},{"id":"106750","messageId":"49AC7C2B.2050505@lysator.liu.se","threadId":"18100","inReplyTo":"alpine.DEB.1.00.0903030126530.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH] git filter-branch: Process commits in --date-order","fromName":"Peter Rosin","fromEmail":"peda@lysator.liu.se","sentAt":"2009-03-03T00:39:07Z","receivedAt":"2009-03-03T00:39:07Z","isPatch":true,"sender":{"key":"peda@lysator.liu.se","avatar":null},"body":"Hi Johannes,\n\nDen 2009-03-03 01:28 skrev Johannes Schindelin:\n> Hi,\n> \n> On Tue, 3 Mar 2009, Peter Rosin wrote:\n> \n>> When converting an svn repository to git, I am filtering the commits\n>> using --msg-filter. During this conversion I want to use the\n>> .git-rewrite/map data to fill in references to other commits. In the\n>> svn repo, there is a commit message e.g. \"Cherry-pick r207\", and I\n>> want to append \"r207 = <commit>\" to the git commit message, as r207\n>> no longer means very much. This works fine when the git commit\n>> corresponding to r207 has been filtered before the current commit, and\n>> is present in the map. When filtering in --topo-order, this is not\n>> always the case, making it impossible to look up the git commit.\n> \n> I'd rather have this as an option.  God knows what breaks with time-skewed \n> repositories if you use date-order instead of topo-order, and I'd rather \n> not break that not quite uncommon case.\n\nWell, from the git rev-list docs:\n\n        --date-order\n               This option is similar to --topo-order in the sense that no\n               parent comes before all of its children, but otherwise things\n               are still ordered in the commit timestamp order.\n\nSounds pretty safe to me?\n\nCheers,\nPeter\n"},{"id":"106748","messageId":"7vbpsjl97d.fsf@gitster.siamese.dyndns.org","threadId":"18100","inReplyTo":"alpine.DEB.1.00.0903030126530.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH] git filter-branch: Process commits in --date-order","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-03T00:51:50Z","receivedAt":"2009-03-03T00:51:50Z","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 Tue, 3 Mar 2009, Peter Rosin wrote:\n>\n>> When converting an svn repository to git, I am filtering the commits\n>> using --msg-filter. During this conversion I want to use the\n>> .git-rewrite/map data to fill in references to other commits. In the\n>> svn repo, there is a commit message e.g. \"Cherry-pick r207\", and I\n>> want to append \"r207 = <commit>\" to the git commit message, as r207\n>> no longer means very much. This works fine when the git commit\n>> corresponding to r207 has been filtered before the current commit, and\n>> is present in the map. When filtering in --topo-order, this is not\n>> always the case, making it impossible to look up the git commit.\n>\n> I'd rather have this as an option.  God knows what breaks with time-skewed \n> repositories if you use date-order instead of topo-order, and I'd rather \n> not break that not quite uncommon case.\n\nI am wondering if it even makes sense to allow users to disable\ntopological ordering.\n\nDoesn't filter-branch have the same \"child commits build on top of parent\ncommits\" dependency as fast-export has?  And didn't you guys fix\nfast-export recently?\n"},{"id":"106778","messageId":"49ACDF3A.1090309@viscovery.net","threadId":"18100","inReplyTo":"7vbpsjl97d.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git filter-branch: Process commits in --date-order","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-03-03T07:41:46Z","receivedAt":"2009-03-03T07:41:46Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> I am wondering if it even makes sense to allow users to disable\n> topological ordering.\n> \n> Doesn't filter-branch have the same \"child commits build on top of parent\n> commits\" dependency as fast-export has?  And didn't you guys fix\n> fast-export recently?\n\nDoesn't --date-order have the same guarantee as --topo-order with respect\nto parents and children, only that commits that can be rearranged such\nthat the guarantee remains are emitted in date order?\n\nAnyway, the patch is unnecessary: If --date-order is needed, it can be\npassed on the command line; this will override --topo-order.\n\n-- Hannes\n"}]}