{"thread":{"id":"4198","subject":"[PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","startedAt":"2006-05-18T21:35:20Z","lastAt":"2006-05-19T22:26:45Z","messageCount":16,"participants":["Yann Dirson","Linus Torvalds","Junio C Hamano","Jakub Narebski","David Lang"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"20245","messageId":"20060518213519.14577.67309.stgit@gandelf.nowhere.earth","threadId":"4198","inReplyTo":null,"subject":"[PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-05-18T21:35:20Z","receivedAt":"2006-05-18T21:35:20Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nThis test fails with 1.3.x and HEAD.  This is a very serious bug, since it\ncauses data loss.\n\nI am not sure whether it is normal that git-fsck-objects does not retun an\nerror code, while we can see it reports the inconsistency in --verbose\nmode.  At least trying to directly access the dropped commit triggers an\nerror anyway.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n t/t6200-prune-grafts.sh |   28 ++++++++++++++++++++++++++++\n 1 files changed, 28 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t6200-prune-grafts.sh b/t/t6200-prune-grafts.sh\nnew file mode 100755\nindex 0000000..80d0d59\n--- /dev/null\n+++ b/t/t6200-prune-grafts.sh\n@@ -0,0 +1,28 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2006 Yann Dirson\n+#\n+set -e\n+\n+test_description='Test that git-prune does not nuke revs hidden by a graft'\n+\n+. ./test-lib.sh\n+\n+echo First > A && git-add A && git-commit -m \"Add A.\"\n+echo First > B && git-add B && git-commit -m \"Add B.\"\n+echo Second >> A && git-update-index A && git-commit -m \"Append to A.\"\n+\n+test_expect_success 'initial state is valid' 'git-fsck-objects'\n+\n+echo $(git-rev-parse HEAD) $(git-rev-parse HEAD^^) > .git/info/grafts\n+\n+test_expect_success 'grafted state is valid' 'git-fsck-objects'\n+test_expect_success 'prune with the graft in effect' 'git-prune'\n+test_expect_success 'grafted state is valid' 'git-fsck-objects'\n+\n+rm .git/info/grafts\n+\n+test_expect_success 'grafted state is still valid' 'git-fsck-objects'\n+test_expect_success 'previously-hidden rev is still there' 'git-cat-file commit HEAD^'\n+\n+test_done\n"},{"id":"20246","messageId":"Pine.LNX.4.64.0605181435230.10823@g5.osdl.org","threadId":"4198","inReplyTo":"20060518213519.14577.67309.stgit@gandelf.nowhere.earth","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-18T21:37:06Z","receivedAt":"2006-05-18T21:37:06Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 18 May 2006, Yann Dirson wrote:\n> \n> This test fails with 1.3.x and HEAD.  This is a very serious bug, since it\n> causes data loss.\n\nIs it/does it?\n\nI'd assume that if you have a graft, you _want_ the history to be hidden \nand pruned. \n\nThat's how you'd drop history, if you wanted to do it on purpose.\n\n\t\tLinus\n"},{"id":"20247","messageId":"7viro3nh07.fsf@assigned-by-dhcp.cox.net","threadId":"4198","inReplyTo":"Pine.LNX.4.64.0605181435230.10823@g5.osdl.org","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-18T21:46:16Z","receivedAt":"2006-05-18T21:46:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> Is it/does it?\n>\n> I'd assume that if you have a graft, you _want_ the history to be hidden \n> and pruned. \n>\n> That's how you'd drop history, if you wanted to do it on purpose.\n\nI haven't looked at what the test does, but I think he is\ntalking about the opposite.  fsck by design does not honor\ngrafts, and if you grafted a history back to your true root\ncommit, that \"older\" history will be lost.\n"},{"id":"20251","messageId":"Pine.LNX.4.64.0605181500470.10823@g5.osdl.org","threadId":"4198","inReplyTo":"7viro3nh07.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-18T22:01:16Z","receivedAt":"2006-05-18T22:01:16Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 18 May 2006, Junio C Hamano wrote:\n> \n> I haven't looked at what the test does, but I think he is\n> talking about the opposite.  fsck by design does not honor\n> grafts, and if you grafted a history back to your true root\n> commit, that \"older\" history will be lost.\n\nAhh. Ok. Gotcha.\n\n\t\tLinus\n"},{"id":"20252","messageId":"20060518222045.GB6535@nowhere.earth","threadId":"4198","inReplyTo":"7viro3nh07.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-05-18T22:20:45Z","receivedAt":"2006-05-18T22:20:45Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Thu, May 18, 2006 at 02:46:16PM -0700, Junio C Hamano wrote:\n> Linus Torvalds <torvalds@osdl.org> writes:\n> \n> > Is it/does it?\n> >\n> > I'd assume that if you have a graft, you _want_ the history to be hidden \n> > and pruned. \n> >\n> > That's how you'd drop history, if you wanted to do it on purpose.\n> \n> I haven't looked at what the test does, but I think he is\n> talking about the opposite.  fsck by design does not honor\n> grafts, and if you grafted a history back to your true root\n> commit, that \"older\" history will be lost.\n\nI'm not sure I understand what you're saying.  AFACT fsck does not\nignore grafts: if a rev is not accessible from heads because of a\ngraft, prune drops it, and fsck does not see a problem.\n\nLinus, I understand your point, but the current situation is\nproblematic: a graft does not get propagated by cg-clone (and I\nsuppose not by git-clone or git-fetch either), so cloning a tree which\nhas undergone such a pruning operation results in an incomplete clone\n(indeed it is how I met the problem).  Since grafts are supposed to\nhave local effect only (as far as I understand), I see it as a bad\nindication to have such a remote effect.\n\nMaybe to make things safe, prune should by default consider both\nphysical and grafted parents as accessible, and a flag could be added\nto get the current behaviour for people really knowing what they're\ndoing ?\n\nBest regards,\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"20254","messageId":"7v64k3nf6u.fsf@assigned-by-dhcp.cox.net","threadId":"4198","inReplyTo":"Pine.LNX.4.64.0605181500470.10823@g5.osdl.org","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-18T22:25:29Z","receivedAt":"2006-05-18T22:25:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> On Thu, 18 May 2006, Junio C Hamano wrote:\n>> \n>> I haven't looked at what the test does, but I think he is\n>> talking about the opposite.  fsck by design does not honor\n>> grafts, and if you grafted a history back to your true root\n>> commit, that \"older\" history will be lost.\n>\n> Ahh. Ok. Gotcha.\n>\n> \t\tLinus\n\nIs it really OK?\n\nI said \"fsck by design does not honor\" as a flamebait.\n\nAnd what I said was completely untrue.  Sorry.\n\nIf you have a commit chain A->B->C and graft B away by saying\nC's parent is A, fsck does read graft and discards B.  But that\nis what the user asked to do, so I agree with your initial\nresponse to Yann.\n\nAnd the opposite case of grafting older history back to the real\nroot commit was a false alarm.  You would not lose such a\nhistory, because the ancestry traversal will go right through\nthe real root and traverses the older history.\n"},{"id":"20255","messageId":"7vzmhfm03s.fsf@assigned-by-dhcp.cox.net","threadId":"4198","inReplyTo":"20060518222045.GB6535@nowhere.earth","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-18T22:36:39Z","receivedAt":"2006-05-18T22:36:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@altern.org> writes:\n\n> I'm not sure I understand what you're saying.\n\nPlease don't; I was asleep when I typed it -- sorry.\n\nI was hoping fsck was doing the right thing for a very low level\ntool -- verify commit objects itself, without relying on the\nobject parser machinery which does funky things like grafts.\n\nApparently it doesn't -- which is mostly good.  You can safely\nremove commits you wanted to discard by grafting it away like\nyour test did, and you can keep unrelated history you grafted to\nthe back of your real root commit.\n\nFor the \"clone without propagating grafts\" issue, I think we\nneed to have a way to communicate grafts across repositories.\nAs you say, grafts is a local policy issue, but when you start\ncloning you _are_ sharing that local policy across repositories.\nFutzing fsck to honor and ignore grafts at the same time sounds\nlike a band-aid to me.\n"},{"id":"20256","messageId":"20060518225216.GC6535@nowhere.earth","threadId":"4198","inReplyTo":"20060518222045.GB6535@nowhere.earth","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-05-18T22:52:16Z","receivedAt":"2006-05-18T22:52:16Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Fri, May 19, 2006 at 12:20:45AM +0200, Yann Dirson wrote:\n> On Thu, May 18, 2006 at 02:46:16PM -0700, Junio C Hamano wrote:\n> > Linus Torvalds <torvalds@osdl.org> writes:\n> > \n> > > Is it/does it?\n> > >\n> > > I'd assume that if you have a graft, you _want_ the history to be hidden \n> > > and pruned. \n> > >\n> > > That's how you'd drop history, if you wanted to do it on purpose.\n> > \n> > I haven't looked at what the test does, but I think he is\n> > talking about the opposite.  fsck by design does not honor\n> > grafts, and if you grafted a history back to your true root\n> > commit, that \"older\" history will be lost.\n> \n> I'm not sure I understand what you're saying.  AFACT fsck does not\n> ignore grafts: if a rev is not accessible from heads because of a\n> graft, prune drops it, and fsck does not see a problem.\n> \n> Linus, I understand your point, but the current situation is\n> problematic: a graft does not get propagated by cg-clone (and I\n> suppose not by git-clone or git-fetch either), so cloning a tree which\n> has undergone such a pruning operation results in an incomplete clone\n> (indeed it is how I met the problem).  Since grafts are supposed to\n> have local effect only (as far as I understand), I see it as a bad\n> indication to have such a remote effect.\n\nTo make my point maybe more clear: if someone really wants to make a\ngraft permanent, wouldn't some history rewriting (eg. with\ncg-admin-rewritehist, but see the patch I posted against it) be the\nway to go, instead of relying on out-of-band transfer of graft data ?\n\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"20257","messageId":"7vsln7lzbj.fsf@assigned-by-dhcp.cox.net","threadId":"4198","inReplyTo":"20060518225216.GC6535@nowhere.earth","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-18T22:53:36Z","receivedAt":"2006-05-18T22:53:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@altern.org> writes:\n\n> To make my point maybe more clear: if someone really wants to make a\n> graft permanent, wouldn't some history rewriting ... be the\n> way to go,...\n\nYes.\n"},{"id":"20294","messageId":"20060519185558.GE6535@nowhere.earth","threadId":"4198","inReplyTo":"7vsln7lzbj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-05-19T18:55:58Z","receivedAt":"2006-05-19T18:55:58Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Thu, May 18, 2006 at 03:53:36PM -0700, Junio C Hamano wrote:\n> Yann Dirson <ydirson@altern.org> writes:\n> \n> > To make my point maybe more clear: if someone really wants to make a\n> > graft permanent, wouldn't some history rewriting ... be the\n> > way to go,...\n> \n> Yes.\n\nSo if temporary usage is a typical use for grafts, don't we want to\nprotect people using them from pruning ?  I got no feedback to my\nsuggestion of changing the default behaviour, even to say it was a bad\nidea :)\n\nBest regards,\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"20295","messageId":"e4l4j1$vkq$1@sea.gmane.org","threadId":"4198","inReplyTo":"20060519185558.GE6535@nowhere.earth","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-05-19T19:00:00Z","receivedAt":"2006-05-19T19:00:00Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Yann Dirson wrote:\n\n> On Thu, May 18, 2006 at 03:53:36PM -0700, Junio C Hamano wrote:\n>> Yann Dirson <ydirson@altern.org> writes:\n>> \n>> > To make my point maybe more clear: if someone really wants to make a\n>> > graft permanent, wouldn't some history rewriting ... be the\n>> > way to go,...\n>> \n>> Yes.\n> \n> So if temporary usage is a typical use for grafts, don't we want to\n> protect people using them from pruning ?  I got no feedback to my\n> suggestion of changing the default behaviour, even to say it was a bad\n> idea :)\n\nPerhaps prune should be conservative by default, and follow both grafts and\noriginal parents, and use appropriate options to preserve or not preserve\ngrafts.\n\n-- \nJakub Narebski\nWarsaw, Poland\n"},{"id":"20296","messageId":"Pine.LNX.4.64.0605191159520.10823@g5.osdl.org","threadId":"4198","inReplyTo":"20060519185558.GE6535@nowhere.earth","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-19T19:02:48Z","receivedAt":"2006-05-19T19:02:48Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 19 May 2006, Yann Dirson wrote:\n\n> On Thu, May 18, 2006 at 03:53:36PM -0700, Junio C Hamano wrote:\n> > Yann Dirson <ydirson@altern.org> writes:\n> > \n> > > To make my point maybe more clear: if someone really wants to make a\n> > > graft permanent, wouldn't some history rewriting ... be the\n> > > way to go,...\n> > \n> > Yes.\n> \n> So if temporary usage is a typical use for grafts, don't we want to\n> protect people using them from pruning ?  I got no feedback to my\n> suggestion of changing the default behaviour, even to say it was a bad\n> idea :)\n\nI don't actually know how much grafts end up being used. Right now, the \nonly really valid use I know about is to graft together the old kernel \nhistory kind of thing, and I suspect not a whole lot of people do that (I \nkeep a separate kernel history tree around for when I need to look at it, \nand it doesn't happen all that often).\n\nSo I think the lack of feedback on the graft-related issue comes directly \nfrom that lack of graft usage. \n\nWe _could_ decide that fsck should just follow the \"real parents\" and the \ngrafts _both_. That's the safe thing to do by default. Possibly with a \nflag to say \"prefer one over the other\", or even a \"prefer which-ever \nexists\".\n\n\t\tLinus\n"},{"id":"20297","messageId":"20060519202540.GF6535@nowhere.earth","threadId":"4198","inReplyTo":"Pine.LNX.4.64.0605191159520.10823@g5.osdl.org","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-05-19T20:25:40Z","receivedAt":"2006-05-19T20:25:40Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Fri, May 19, 2006 at 12:02:48PM -0700, Linus Torvalds wrote:\n> \n> \n> On Fri, 19 May 2006, Yann Dirson wrote:\n> \n> > On Thu, May 18, 2006 at 03:53:36PM -0700, Junio C Hamano wrote:\n> > > Yann Dirson <ydirson@altern.org> writes:\n> > > \n> > > > To make my point maybe more clear: if someone really wants to make a\n> > > > graft permanent, wouldn't some history rewriting ... be the\n> > > > way to go,...\n> > > \n> > > Yes.\n> > \n> > So if temporary usage is a typical use for grafts, don't we want to\n> > protect people using them from pruning ?  I got no feedback to my\n> > suggestion of changing the default behaviour, even to say it was a bad\n> > idea :)\n> \n> I don't actually know how much grafts end up being used. Right now, the \n> only really valid use I know about is to graft together the old kernel \n> history kind of thing, and I suspect not a whole lot of people do that (I \n> keep a separate kernel history tree around for when I need to look at it, \n> and it doesn't happen all that often).\n> \n> So I think the lack of feedback on the graft-related issue comes directly \n> from that lack of graft usage. \n\nI take this as an incentive to share my use of the think :)\n\nOn several projects managed with CVS, I use a git mirror (maintained\nwith git-cvsimport for now) to prepare my sets of patches with stgit,\nbefore committing them to cvs (through git-cvsexportcommit).  In this\ncontext, since merges are not recorded in cvs, and cvs insists that\nall branches must derive from the trunk, I use grafts to:\n\n\t1. record merges\n\t2. cause git to believe that the trunk derives from the vendor\n\t   branch\n\t3. hide those pseudo revisions cvs adds to rcs files saying\n\t   \"file was initially added to branch foo\"\n\nIt is the latter use which caused the loss previously mentionned.  It\ncould have been avoided by making cvsimport, or more likely cvsps more\nclever wrt this case.\n\n\n> We _could_ decide that fsck should just follow the \"real parents\" and the \n> grafts _both_. That's the safe thing to do by default. Possibly with a \n> flag to say \"prefer one over the other\", or even a \"prefer which-ever \n> exists\".\n\nI'm not sure I see how \"prefer which-ever exists\" would be useful - do\nyou have anything precise in mind ?\n\nBest regards,\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"20298","messageId":"Pine.LNX.4.64.0605191344200.10823@g5.osdl.org","threadId":"4198","inReplyTo":"20060519202540.GF6535@nowhere.earth","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-19T20:45:57Z","receivedAt":"2006-05-19T20:45:57Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 19 May 2006, Yann Dirson wrote:\n> \n> > We _could_ decide that fsck should just follow the \"real parents\" and the \n> > grafts _both_. That's the safe thing to do by default. Possibly with a \n> > flag to say \"prefer one over the other\", or even a \"prefer which-ever \n> > exists\".\n> \n> I'm not sure I see how \"prefer which-ever exists\" would be useful - do\n> you have anything precise in mind ?\n\nIt would be a \"once you've pruned one or the other, don't complain any \nmore about the fact that it doesn't exist\" flag.\n\n\t\tLinus\n"},{"id":"20303","messageId":"7v4pzlirje.fsf@assigned-by-dhcp.cox.net","threadId":"4198","inReplyTo":"Pine.LNX.4.64.0605191159520.10823@g5.osdl.org","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-19T22:22:13Z","receivedAt":"2006-05-19T22:22:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> On Fri, 19 May 2006, Yann Dirson wrote:\n>\n>> On Thu, May 18, 2006 at 03:53:36PM -0700, Junio C Hamano wrote:\n>> > Yann Dirson <ydirson@altern.org> writes:\n>> > \n>> > > To make my point maybe more clear: if someone really wants to make a\n>> > > graft permanent, wouldn't some history rewriting ... be the\n>> > > way to go,...\n>> > \n>> > Yes.\n>> \n>> So if temporary usage is a typical use for grafts, don't we want to\n>> protect people using them from pruning ?  I got no feedback to my\n>> suggestion of changing the default behaviour, even to say it was a bad\n>> idea :)\n\nI just gave a terse \"Yes\" because I agree with Yann that if\nreally a permanent history rewriting is needed it should be done\nby history rewriting not with graft (I do not necessarily\nencourage people to rewrite history but if somebody wants to,\nthat is).\n\n> We _could_ decide that fsck should just follow the \"real parents\" and the \n> grafts _both_. That's the safe thing to do by default. Possibly with a \n> flag to say \"prefer one over the other\", or even a \"prefer which-ever \n> exists\".\n\nI agree with everything Linus said about the current grafts\nusage.  My vote for fsck is to make it default to follow both by\ndefault for safety, and perhaps an optional --ignore-graft\nflag.\n"},{"id":"20304","messageId":"Pine.LNX.4.62.0605191526060.2828@qynat.qvtvafvgr.pbz","threadId":"4198","inReplyTo":"Pine.LNX.4.64.0605191159520.10823@g5.osdl.org","subject":"Re: [PATCH] [BUG] Add a test to check git-prune does not throw awayrevs hidden by a graft.","fromName":"David Lang","fromEmail":"dlang@digitalinsight.com","sentAt":"2006-05-19T22:26:45Z","receivedAt":"2006-05-19T22:26:45Z","isPatch":true,"sender":{"key":"dlang@digitalinsight.com","avatar":null},"body":"On Fri, 19 May 2006, Linus Torvalds wrote:\n\n> On Fri, 19 May 2006, Yann Dirson wrote:\n>\n>> On Thu, May 18, 2006 at 03:53:36PM -0700, Junio C Hamano wrote:\n>>> Yann Dirson <ydirson@altern.org> writes:\n>>>\n>>>> To make my point maybe more clear: if someone really wants to make a\n>>>> graft permanent, wouldn't some history rewriting ... be the\n>>>> way to go,...\n>>>\n>>> Yes.\n>>\n>> So if temporary usage is a typical use for grafts, don't we want to\n>> protect people using them from pruning ?  I got no feedback to my\n>> suggestion of changing the default behaviour, even to say it was a bad\n>> idea :)\n>\n> I don't actually know how much grafts end up being used. Right now, the\n> only really valid use I know about is to graft together the old kernel\n> history kind of thing, and I suspect not a whole lot of people do that (I\n> keep a separate kernel history tree around for when I need to look at it,\n> and it doesn't happen all that often).\n>\n> So I think the lack of feedback on the graft-related issue comes directly\n> from that lack of graft usage.\n\nif/when shallow clones become available I would expect to see graft useage \nclimb significantly\n\nDavid Lang\n\n-- \nThere are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.\n  -- C.A.R. Hoare\n"}]}