{"thread":{"id":"28422","subject":"[RFC] fast-import: note deletion command","startedAt":"2011-09-18T20:07:46Z","lastAt":"2011-09-18T21:55:29Z","messageCount":10,"participants":["Dmitry Ivankov","Jonathan Nieder","Sverre Rabbelier"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"175742","messageId":"CA+gfSn9sdTzQghqQp6hcO-9kN9mPx2JLRig79Rgx2FqGWXXp=A@mail.gmail.com","threadId":"28422","inReplyTo":null,"subject":"[RFC] fast-import: note deletion command","fromName":"Dmitry Ivankov","fromEmail":"divanorama@gmail.com","sentAt":"2011-09-18T20:07:46Z","receivedAt":"2011-09-18T20:07:46Z","isPatch":false,"sender":{"key":"divanorama@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158999?v=4"},"body":"Hi,\n\nfast-import is able to write notes provided a command\nN <note_content_data_specification> <commit_specification>\n\nThere is no documented command to delete a note. It can't be\neasily replaced with Delete command on notes tree because\nof notes fanout.\n\nBut fast-import interprets 0{40} data_specification as a note\ndeletion command. It is consistent with fast-import internals\nwhere null_sha1 is used for absent/unknown object. But is\nnot consistent with file Modify command nor looks like a common\nconvention in git ui.\n\nSo the questions are:\n- should 0{40} not be treated as deletion toggle? Downside is that\nit is used as one in t/t9301-fast-import-notes.sh.\n- how should a documented way to delete notes look like?\nND commit_sha1 # One may think there are also NC, NR, NM\nN delete commit_sha1\n# Only :mark, full-40-byte-sha1 and 'inline' are allowed currently.\n# So no clashes arise, but then one may also want M 'delete' path\n# command to work too.\n"},{"id":"175743","messageId":"20110918203506.GG2308@elie","threadId":"28422","inReplyTo":"CA+gfSn9sdTzQghqQp6hcO-9kN9mPx2JLRig79Rgx2FqGWXXp=A@mail.gmail.com","subject":"Re: [RFC] fast-import: note deletion command","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-09-18T20:35:06Z","receivedAt":"2011-09-18T20:35:06Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: Sverre for fast-import, Johan for notes, Thomas as a user of\n the note import feature, snipping less for their benefit)\n\nDmitry Ivankov wrote:\n\n> Hi,\n>\n> fast-import is able to write notes provided a command\n> N <note_content_data_specification> <commit_specification>\n>\n> There is no documented command to delete a note. It can't be\n> easily replaced with Delete command on notes tree because\n> of notes fanout.\n>\n> But fast-import interprets 0{40} data_specification as a note\n> deletion command. It is consistent with fast-import internals\n> where null_sha1 is used for absent/unknown object. But is\n> not consistent with file Modify command nor looks like a common\n> convention in git ui.\n\nRight.\n\n> So the questions are:\n> - should 0{40} not be treated as deletion toggle? Downside is that\n> it is used as one in t/t9301-fast-import-notes.sh.\n> - how should a documented way to delete notes look like?\n> ND commit_sha1 # One may think there are also NC, NR, NM\n> N delete commit_sha1\n> # Only :mark, full-40-byte-sha1 and 'inline' are allowed currently.\n> # So no clashes arise, but then one may also want M 'delete' path\n> # command to work too.\n\nIf I were doing it:\n\n - advertise \"N 0{40} <commit>\" as the historical way to delete a\n   note, and make sure it keeps working\n\n - introduce 'ND' or 'notedelete <commit>' as a human-friendly\n   synonym, keeping in mind that NC and NR could be introduced in the\n   future if there is demand for them.\n\n - don't add any new magic \"N <magic keyword> <commit>\" commands,\n   since it's hard to know when they will clash with some VCS's\n   convention for object names.\n\nI imagine there are plenty of other acceptable ways to accomplish\nthese things, though. :)  Thanks for looking into it.\n"},{"id":"175744","messageId":"CAGdFq_hpA95Kj4eMr4e1duuXTpr+OkkwF4K5bTapXEi9UjWcSA@mail.gmail.com","threadId":"28422","inReplyTo":"20110918203506.GG2308@elie","subject":"Re: [RFC] fast-import: note deletion command","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-09-18T20:39:40Z","receivedAt":"2011-09-18T20:39:40Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Sun, Sep 18, 2011 at 22:35, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> ND commit_sha1 # One may think there are also NC, NR, NM\n>> N delete commit_sha1\n>> # Only :mark, full-40-byte-sha1 and 'inline' are allowed currently.\n>> # So no clashes arise, but then one may also want M 'delete' path\n>> # command to work too.\n>\n> If I were doing it:\n>\n>  - advertise \"N 0{40} <commit>\" as the historical way to delete a\n>   note, and make sure it keeps working\n>\n>  - introduce 'ND' or 'notedelete <commit>' as a human-friendly\n>   synonym, keeping in mind that NC and NR could be introduced in the\n>   future if there is demand for them.\n\nIs this perhaps a good moment to also think about branch deletion?\nThat came up earlier as well, and thinking about that might give us\nsome insights in how to deal with deletions uniformly.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"175745","messageId":"CA+gfSn9CsL4tz30B62mDzALdyy1RTFiRT4a1zdJ8pR8aTdcpXA@mail.gmail.com","threadId":"28422","inReplyTo":"CAGdFq_hpA95Kj4eMr4e1duuXTpr+OkkwF4K5bTapXEi9UjWcSA@mail.gmail.com","subject":"Re: [RFC] fast-import: note deletion command","fromName":"Dmitry Ivankov","fromEmail":"divanorama@gmail.com","sentAt":"2011-09-18T20:59:56Z","receivedAt":"2011-09-18T20:59:56Z","isPatch":false,"sender":{"key":"divanorama@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158999?v=4"},"body":"On Mon, Sep 19, 2011 at 2:39 AM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> Heya,\n>\n>>\n>> If I were doing it:\n>>\n>>  - advertise \"N 0{40} <commit>\" as the historical way to delete a\n>>   note, and make sure it keeps working\n>>\n>>  - introduce 'ND' or 'notedelete <commit>' as a human-friendly\n>>   synonym, keeping in mind that NC and NR could be introduced in the\n>>   future if there is demand for them.\n>\n> Is this perhaps a good moment to also think about branch deletion?\n> That came up earlier as well, and thinking about that might give us\n> some insights in how to deal with deletions uniformly.\nAlso maybe marks deletion, getting mark sha1,  resetting a mark with\nexplicit sha1. But most probably not tags deletion.\n\nAnd going much further on commands, following look nice to have:\n- 'ls' storing result to a mark (to allow us not to compute sha1/store\n  object if we don't want to)\n- marks namespaces (to keep ls mark separately, mark deletion will\n  do too, if it's only a single temporary mark). Maybe like ::nr:mark.\n\n>\n> --\n> Cheers,\n>\n> Sverre Rabbelier\n>\n"},{"id":"175746","messageId":"20110918210336.GH2308@elie","threadId":"28422","inReplyTo":"CA+gfSn9CsL4tz30B62mDzALdyy1RTFiRT4a1zdJ8pR8aTdcpXA@mail.gmail.com","subject":"fast-import wishlist (Re: [RFC] fast-import: note deletion command)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-09-18T21:03:36Z","receivedAt":"2011-09-18T21:03:36Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Dmitry Ivankov wrote:\n> On Mon, Sep 19, 2011 at 2:39 AM, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n\n>> Is this perhaps a good moment to also think about branch deletion?\n\nIt might be a good temporal moment, but it's not quite the right\nthread for it. :)  If someone wants to maintain a fast-import wishlist\nin a wiki somewhere, it sounds like it could be useful to some people\n(I prefer to read patches and stories about particular use cases,\nmyself :)).\n\n>> That came up earlier as well, and thinking about that might give us\n>> some insights in how to deal with deletions uniformly.\n>\n> Also maybe marks deletion, getting mark sha1,  resetting a mark with\n> explicit sha1. But most probably not tags deletion.\n>\n> And going much further on commands, following look nice to have:\n> - 'ls' storing result to a mark (to allow us not to compute sha1/store\n>   object if we don't want to)\n> - marks namespaces (to keep ls mark separately, mark deletion will\n>   do too, if it's only a single temporary mark). Maybe like ::nr:mark.\n\nRegards,\nJonathan\n"},{"id":"175750","messageId":"20110918211836.GI2308@elie","threadId":"28422","inReplyTo":"CAGdFq_hpA95Kj4eMr4e1duuXTpr+OkkwF4K5bTapXEi9UjWcSA@mail.gmail.com","subject":"Branch deletion (Re: [RFC] fast-import: note deletion command)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-09-18T21:18:36Z","receivedAt":"2011-09-18T21:18:36Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Sverre Rabbelier wrote:\n\n> Is this perhaps a good moment to also think about branch deletion?\n> That came up earlier as well, and thinking about that might give us\n> some insights in how to deal with deletions uniformly.\n\nSorry, my earlier reply missed the point.  To answer your question:\nDmitry's RFC was about deleting individual notes rather than entire\nnotes refs, so it is not too closely related to branch deletion.\n\nA new \"deleteref\" command would be a very simple addition, and the UI\nseems pretty obvious.  The main concern in adding such a thing is that\nit destroys history, while currently \"git fast-import\" without -f does\nnot provide any commands that can do that.  So presumably one would\nwant to do one of the following:\n\n - only allow deletion of refs that were not present at the start of\n   the import, or\n - add a command-line option to permit deletion of refs, so it doesn't\n   happen by mistake when misparsing a stream.\n\nIt would also be interesting to see an example use (do you remember\nthe earlier thread where it came up?) to make sure the UI fits it\nwell.  In most typical cases I can imagine, direct use of \"git\nupdate-ref -d\" would work better.  In the case of remote helpers, IIRC\nthere was already a need for the transport-helper to handle the final\nref updates so \"git fetch\" can write a nice notice about them to the\nconsole.\n"},{"id":"175752","messageId":"CAGdFq_gH=u1BU6k3Z23Lo9mOSE4Rq-6nWU0EE91CQNpxksGw5w@mail.gmail.com","threadId":"28422","inReplyTo":"20110918211836.GI2308@elie","subject":"Re: Branch deletion (Re: [RFC] fast-import: note deletion command)","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-09-18T21:38:07Z","receivedAt":"2011-09-18T21:38:07Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Sun, Sep 18, 2011 at 23:18, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> In the case of remote helpers, IIRC there was already a need for\n> the transport-helper to handle the final ref updates so \"git fetch\"\n> can write a nice notice about them to the console.\n\nThat book-keeping is trivial to do. The problem currently is that when\nyou try to \"git push origin :experimental-branch\", there is no way for\nthe transport-helper code to tell the helper to delete the ref.\nSomething like 'deleteref' sounds sane I suppose, and I agree that\nthere should be some sort of safety switch :). I think we need a new\nfeature announcing that we require support for it, and then the\nimporter can abort right away if the user doesn't want to have their\nrefs deleted.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"175756","messageId":"20110918214954.GL2308@elie","threadId":"28422","inReplyTo":"CAGdFq_gH=u1BU6k3Z23Lo9mOSE4Rq-6nWU0EE91CQNpxksGw5w@mail.gmail.com","subject":"Re: Branch deletion (Re: [RFC] fast-import: note deletion command)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-09-18T21:49:54Z","receivedAt":"2011-09-18T21:49:54Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Sverre Rabbelier wrote:\n\n> The problem currently is that when\n> you try to \"git push origin :experimental-branch\", there is no way for\n> the transport-helper code to tell the helper to delete the ref.\n\nAh!  Thanks for explaining.\n\nIt also occurs to me that\n\n\treset refs/heads/experimental-branch\n\n\t... rest of the fast-import stream comes here ...\n\ncould be used as an especially non-self-explanatory way to express\nthis kind of thing. :)  No idea whether that works already.  A\ndeleteref command and deleteref feature documented to be meant for\nthis purpose sound handy to me.\n\nBy the way, what does the \"export\" command do in the following\nsituation?\n\n\tgit push origin something-big:master\n\nDoes it assume the remote-tracking branch for master reflects what's\navailable on the other end and send a stream for\norigin/master..something-big, or does it send the entire history of\nsomething-big?\n"},{"id":"175759","messageId":"CA+gfSn_e3yY9eQ6O1zMdTituZMAv+a0AtF4cKrEOvBwY63pihA@mail.gmail.com","threadId":"28422","inReplyTo":"20110918214954.GL2308@elie","subject":"Re: Branch deletion (Re: [RFC] fast-import: note deletion command)","fromName":"Dmitry Ivankov","fromEmail":"divanorama@gmail.com","sentAt":"2011-09-18T21:54:17Z","receivedAt":"2011-09-18T21:54:17Z","isPatch":false,"sender":{"key":"divanorama@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158999?v=4"},"body":"On Mon, Sep 19, 2011 at 3:49 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Sverre Rabbelier wrote:\n>\n>> The problem currently is that when\n>> you try to \"git push origin :experimental-branch\", there is no way for\n>> the transport-helper code to tell the helper to delete the ref.\n>\n> Ah!  Thanks for explaining.\n>\n> It also occurs to me that\n>\n>        reset refs/heads/experimental-branch\n>\n>        ... rest of the fast-import stream comes here ...\n>\n> could be used as an especially non-self-explanatory way to express\n> this kind of thing. :)  No idea whether that works already.\n     feature force\n     reset refs/heads/experimental-branch\nWill be close. It'll overwrite the branch if any commits are done to\nit. But will\nkeep it as is in case it's not touched in the rest of the fast-import stream.\n\n> A deleteref command and deleteref feature documented to be meant for\n> this purpose sound handy to me.\n>\n> By the way, what does the \"export\" command do in the following\n> situation?\n>\n>        git push origin something-big:master\n>\n> Does it assume the remote-tracking branch for master reflects what's\n> available on the other end and send a stream for\n> origin/master..something-big, or does it send the entire history of\n> something-big?\n>\n"},{"id":"175760","messageId":"CAGdFq_gCVBi1JOsyM=+SVU6HFew_7yaJWaZ-3=AnmDeRkBxntQ@mail.gmail.com","threadId":"28422","inReplyTo":"20110918214954.GL2308@elie","subject":"Re: Branch deletion (Re: [RFC] fast-import: note deletion command)","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-09-18T21:55:29Z","receivedAt":"2011-09-18T21:55:29Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Sun, Sep 18, 2011 at 23:49, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> By the way, what does the \"export\" command do in the following\n> situation?\n>\n>        git push origin something-big:master\n>\n> Does it assume the remote-tracking branch for master reflects what's\n> available on the other end and send a stream for\n> origin/master..something-big, or does it send the entire history of\n> something-big?\n\nWe have a test case for this actually. It goes like this:\n\nchecking known breakage:\n\t(cd clone &&\n\t git push origin new-name:new-refspec\n\t) &&\n\tcompare_refs clone HEAD server refs/heads/new-refspec\n\nEverything up-to-date\nfatal: Needed a single revision\nnot ok 16 - push new branch with old:new refspec # TODO known breakage\n\n\nIn other words, we don't handle it at all. What we do handle a case\nsimilar to what you say, where we have already pushed part of the\nhistory of some-branch, and in that case we do indeed only push the\nneeded objects.\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}