{"thread":{"id":"17784","subject":"filter-branch: Remove original/* (was Re: [RFC] What's the best UI for 'git submodule split'?)","startedAt":"2009-02-14T02:45:09Z","lastAt":"2009-02-16T11:38:12Z","messageCount":12,"participants":["Eric Kidd","Johannes Schindelin","Junio C Hamano","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"104577","messageId":"431341160902131845g58d99635ie0735b433802d6be@mail.gmail.com","threadId":"17784","inReplyTo":null,"subject":"filter-branch: Remove original/* (was Re: [RFC] What's the best UI for 'git submodule split'?)","fromName":"Eric Kidd","fromEmail":"git@randomhacks.net","sentAt":"2009-02-14T02:45:09Z","receivedAt":"2009-02-14T02:45:09Z","isPatch":false,"sender":{"key":"git@randomhacks.net","avatar":null},"body":"On Thu, Feb 12, 2009 at 4:59 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> On Thu, 12 Feb 2009, Eric Kidd wrote:\n>\n> >   rm .git/refs/original # or just use --force below\n>\n> BTW I wanted to get rid of this for a long time now, but I cannot seem to\n> find the time to work on it.  The 'original' refs should not be needed, as\n> that's a job for the reflogs (yeah, people tried to convince me back then,\n> but I finally got it, okay?)\n\nRemoving the original/* directory would certainly make my life easier.\nBut the reflog only stores backups for branch heads, not tags, right?\nIf there's a good way to handle this, I'd be happy to send a patch.\n\nCheers,\nEric\n"},{"id":"104700","messageId":"alpine.DEB.1.00.0902142219010.10279@pacific.mpi-cbg.de","threadId":"17784","inReplyTo":"431341160902131845g58d99635ie0735b433802d6be@mail.gmail.com","subject":"Re: filter-branch: Remove original/* (was Re: [RFC] What's the best UI for 'git submodule split'?)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-14T21:25:31Z","receivedAt":"2009-02-14T21:25:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 13 Feb 2009, Eric Kidd wrote:\n\n> On Thu, Feb 12, 2009 at 4:59 PM, Johannes Schindelin\n> <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > On Thu, 12 Feb 2009, Eric Kidd wrote:\n> >\n> > >   rm .git/refs/original # or just use --force below\n> >\n> > BTW I wanted to get rid of this for a long time now, but I cannot seem \n> > to find the time to work on it.  The 'original' refs should not be \n> > needed, as that's a job for the reflogs (yeah, people tried to \n> > convince me back then, but I finally got it, okay?)\n> \n> Removing the original/* directory would certainly make my life easier. \n> But the reflog only stores backups for branch heads, not tags, right? If \n> there's a good way to handle this, I'd be happy to send a patch.\n\nHmm.  Indeed, we ignore reflogs in log_ref_write() when the ref starts \nwith refs/tags/ (implicitly, not explicitely).\n\nMaybe it is time to change that.\n\nCiao,\nDscho\n"},{"id":"104802","messageId":"7vvdrblcl0.fsf@gitster.siamese.dyndns.org","threadId":"17784","inReplyTo":"alpine.DEB.1.00.0902142219010.10279@pacific.mpi-cbg.de","subject":"Re: filter-branch: Remove original/*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-15T19:33:31Z","receivedAt":"2009-02-15T19:33:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hmm.  Indeed, we ignore reflogs in log_ref_write() when the ref starts \n> with refs/tags/ (implicitly, not explicitely).\n>\n> Maybe it is time to change that.\n\nWhy?  Most tags will be created once and will stay there.  That is how tags\nare supposed to behave, isn't it?\n"},{"id":"104813","messageId":"alpine.DEB.1.00.0902152046090.10279@pacific.mpi-cbg.de","threadId":"17784","inReplyTo":"7vvdrblcl0.fsf@gitster.siamese.dyndns.org","subject":"Re: filter-branch: Remove original/*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-15T19:47:19Z","receivedAt":"2009-02-15T19:47:19Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 15 Feb 2009, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Hmm.  Indeed, we ignore reflogs in log_ref_write() when the ref starts \n> > with refs/tags/ (implicitly, not explicitely).\n> >\n> > Maybe it is time to change that.\n> \n> Why?  Most tags will be created once and will stay there.  That is how \n> tags are supposed to behave, isn't it?\n\nExactly my point.  In the common case, it does not change a thing.\n\nHowever in the case that we _do_ change tags, would you not agree that the \nreflog is _the_ place to record the change?\n\nCiao,\nDscho\n"},{"id":"104823","messageId":"7vvdrbie7k.fsf@gitster.siamese.dyndns.org","threadId":"17784","inReplyTo":"alpine.DEB.1.00.0902152046090.10279@pacific.mpi-cbg.de","subject":"Re: filter-branch: Remove original/*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-15T21:26:39Z","receivedAt":"2009-02-15T21:26:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Why?  Most tags will be created once and will stay there.  That is how \n>> tags are supposed to behave, isn't it?\n>\n> Exactly my point.  In the common case, it does not change a thing.\n\nWrong.\n\nIn the common case, you will create tons of useless files that waste a\ndisk block to store 180-byte or so perr each tag.\n\n> However in the case that we _do_ change tags, would you not agree that the \n> reflog is _the_ place to record the change?\n\nThat merely means whoever changes the tag and wants the record of such an\nupdate, which is uncommon, need to make sure reflog is created for that\ntag (and that tag only).\n"},{"id":"104826","messageId":"alpine.DEB.1.00.0902152230330.10279@pacific.mpi-cbg.de","threadId":"17784","inReplyTo":"7vvdrbie7k.fsf@gitster.siamese.dyndns.org","subject":"Re: filter-branch: Remove original/*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-15T21:33:32Z","receivedAt":"2009-02-15T21:33:32Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 15 Feb 2009, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> Why?  Most tags will be created once and will stay there.  That is how \n> >> tags are supposed to behave, isn't it?\n> >\n> > Exactly my point.  In the common case, it does not change a thing.\n> \n> Wrong.\n> \n> In the common case, you will create tons of useless files that waste a\n> disk block to store 180-byte or so perr each tag.\n\nHmm.  My reasoning was that the reflogs will be purged by git gc anyway, \nand that it might be interesting to be able to know how a tag entered the \ncurrent repository (if it was not too long ago), but you're probably right \non that.\n\n> > However in the case that we _do_ change tags, would you not agree that \n> > the reflog is _the_ place to record the change?\n> \n> That merely means whoever changes the tag and wants the record of such an\n> update, which is uncommon, need to make sure reflog is created for that\n> tag (and that tag only).\n\nThe thing is: we cannot.  At least not at the moment.\n\nI agree that \"git tag\" should not add a reflog.  But one should be \nable to force \"git update-ref\" to create a reflog entry, no?\n\nCiao,\nDscho\n"},{"id":"104829","messageId":"7vbpt3id1w.fsf@gitster.siamese.dyndns.org","threadId":"17784","inReplyTo":"alpine.DEB.1.00.0902152230330.10279@pacific.mpi-cbg.de","subject":"Re: filter-branch: Remove original/*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-15T21:51:39Z","receivedAt":"2009-02-15T21:51:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> That merely means whoever changes the tag and wants the record of such an\n>> update, which is uncommon, need to make sure reflog is created for that\n>> tag (and that tag only).\n>\n> The thing is: we cannot.  At least not at the moment.\n\n$ mkdir -p .git/logs/refs/tags\n$ >.git/logs/refs/tags/junker\n$ git tag junker\n$ wc .git/logs/refs/tags/junker\n  1   8 134 .git/logs/refs/tags/junker\n\nOk, it's not 180 byte as I said, but only 134 bytes.\n"},{"id":"104831","messageId":"7v7i3ricr4.fsf@gitster.siamese.dyndns.org","threadId":"17784","inReplyTo":"7vbpt3id1w.fsf@gitster.siamese.dyndns.org","subject":"Re: filter-branch: Remove original/*","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-15T21:58:07Z","receivedAt":"2009-02-15T21:58:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>>> That merely means whoever changes the tag and wants the record of such an\n>>> update, which is uncommon, need to make sure reflog is created for that\n>>> tag (and that tag only).\n>>\n>> The thing is: we cannot.  At least not at the moment.\n>\n> $ mkdir -p .git/logs/refs/tags\n> $ >.git/logs/refs/tags/junker\n> $ git tag junker\n> $ wc .git/logs/refs/tags/junker\n>   1   8 134 .git/logs/refs/tags/junker\n>\n> Ok, it's not 180 byte as I said, but only 134 bytes.\n\nHaving proven my superiour intelligence ;-) I think I can agree if your\nnext proposal is to toggle reflog on for the tag when \"git tag -f\" is used\nto update an existing tag and core.logAllRefUpdates does not say \"never\"\n(this new value needs to be treated the same as \"false\" for most other\npurposes), and the tag does not already have a reflog.\n"},{"id":"104873","messageId":"slrngphfok.hul.sitaramc@sitaramc.homelinux.net","threadId":"17784","inReplyTo":"7vvdrbie7k.fsf@gitster.siamese.dyndns.org","subject":"Re: filter-branch: Remove original/*","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-02-16T01:19:16Z","receivedAt":"2009-02-16T01:19:16Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-02-15, Junio C Hamano <gitster@pobox.com> wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>>> Why?  Most tags will be created once and will stay there.  That is how \n>>> tags are supposed to behave, isn't it?\n>>\n>> Exactly my point.  In the common case, it does not change a thing.\n>\n> Wrong.\n>\n> In the common case, you will create tons of useless files that waste a\n> disk block to store 180-byte or so perr each tag.\n\nInstead of a separate file for each tag, why not something\nlike logs/TAGS, which just records tag creations.\n\nThe downside is it wouldn't represent a *continuous state*\nof anything in particular, because you can create tags for\nany commit while on any (other) branch.  I'm not smart\nenough to figure out the implications of that across the\nentire system.\n"},{"id":"104935","messageId":"alpine.DEB.1.00.0902161218250.10279@pacific.mpi-cbg.de","threadId":"17784","inReplyTo":"7v7i3ricr4.fsf@gitster.siamese.dyndns.org","subject":"Re: filter-branch: Remove original/*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-16T11:19:40Z","receivedAt":"2009-02-16T11:19:40Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 15 Feb 2009, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> >\n> >>> That merely means whoever changes the tag and wants the record of such an\n> >>> update, which is uncommon, need to make sure reflog is created for that\n> >>> tag (and that tag only).\n> >>\n> >> The thing is: we cannot.  At least not at the moment.\n> >\n> > $ mkdir -p .git/logs/refs/tags\n> > $ >.git/logs/refs/tags/junker\n> > $ git tag junker\n> > $ wc .git/logs/refs/tags/junker\n> >   1   8 134 .git/logs/refs/tags/junker\n> >\n> > Ok, it's not 180 byte as I said, but only 134 bytes.\n> \n> Having proven my superiour intelligence ;-) I think I can agree if your\n> next proposal is to toggle reflog on for the tag when \"git tag -f\" is used\n> to update an existing tag and core.logAllRefUpdates does not say \"never\"\n> (this new value needs to be treated the same as \"false\" for most other\n> purposes), and the tag does not already have a reflog.\n\nActually, to prove my inferior intelligence, I suggest going for the easy \nsolution: replace the update-ref in filter-branch by a call to git tag -f, \nafter making sure that the reflog exists (with >>.git/logs/$tagname).\n\nEric?\n\nCiao,\nDscho\n"},{"id":"104936","messageId":"alpine.DEB.1.00.0902161224140.10279@pacific.mpi-cbg.de","threadId":"17784","inReplyTo":"alpine.DEB.1.00.0902161218250.10279@pacific.mpi-cbg.de","subject":"Re: filter-branch: Remove original/*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-16T11:25:18Z","receivedAt":"2009-02-16T11:25:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 16 Feb 2009, Johannes Schindelin wrote:\n\n> On Sun, 15 Feb 2009, Junio C Hamano wrote:\n> \n> > Junio C Hamano <gitster@pobox.com> writes:\n> > \n> > > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > >\n> > >>> That merely means whoever changes the tag and wants the record of such an\n> > >>> update, which is uncommon, need to make sure reflog is created for that\n> > >>> tag (and that tag only).\n> > >>\n> > >> The thing is: we cannot.  At least not at the moment.\n> > >\n> > > $ mkdir -p .git/logs/refs/tags\n> > > $ >.git/logs/refs/tags/junker\n> > > $ git tag junker\n> > > $ wc .git/logs/refs/tags/junker\n> > >   1   8 134 .git/logs/refs/tags/junker\n> > >\n> > > Ok, it's not 180 byte as I said, but only 134 bytes.\n> > \n> > Having proven my superiour intelligence ;-) I think I can agree if your\n> > next proposal is to toggle reflog on for the tag when \"git tag -f\" is used\n> > to update an existing tag and core.logAllRefUpdates does not say \"never\"\n> > (this new value needs to be treated the same as \"false\" for most other\n> > purposes), and the tag does not already have a reflog.\n> \n> Actually, to prove my inferior intelligence, I suggest going for the easy \n> solution: replace the update-ref in filter-branch by a call to git tag -f, \n> after making sure that the reflog exists (with >>.git/logs/$tagname).\n\nIndeed, this proves my inferior intelligence: the update-ref method at \nleast kept as much information as possible in the tag, including the \ntagger.\n\nSo please strike my suggestion from your memory.\n\nCiao,\nDscho\n"},{"id":"104938","messageId":"alpine.DEB.1.00.0902161234120.10279@pacific.mpi-cbg.de","threadId":"17784","inReplyTo":"alpine.DEB.1.00.0902161224140.10279@pacific.mpi-cbg.de","subject":"Re: filter-branch: Remove original/*","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-16T11:38:12Z","receivedAt":"2009-02-16T11:38:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 16 Feb 2009, Johannes Schindelin wrote:\n\n> On Mon, 16 Feb 2009, Johannes Schindelin wrote:\n> \n> > On Sun, 15 Feb 2009, Junio C Hamano wrote:\n> > \n> > > Junio C Hamano <gitster@pobox.com> writes:\n> > > \n> > > > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > > >\n> > > >>> That merely means whoever changes the tag and wants the record \n> > > >>> of such an update, which is uncommon, need to make sure reflog \n> > > >>> is created for that tag (and that tag only).\n> > > >>\n> > > >> The thing is: we cannot.  At least not at the moment.\n> > > >\n> > > > $ mkdir -p .git/logs/refs/tags\n> > > > $ >.git/logs/refs/tags/junker\n> > > > $ git tag junker\n> > > > $ wc .git/logs/refs/tags/junker\n> > > >   1   8 134 .git/logs/refs/tags/junker\n> > > >\n> > > > Ok, it's not 180 byte as I said, but only 134 bytes.\n> > > \n> > > Having proven my superiour intelligence ;-) I think I can agree if \n> > > your next proposal is to toggle reflog on for the tag when \"git tag \n> > > -f\" is used to update an existing tag and core.logAllRefUpdates does \n> > > not say \"never\" (this new value needs to be treated the same as \n> > > \"false\" for most other purposes), and the tag does not already have \n> > > a reflog.\n> > \n> > Actually, to prove my inferior intelligence, I suggest going for the \n> > easy solution: replace the update-ref in filter-branch by a call to \n> > git tag -f, after making sure that the reflog exists (with \n> > >>.git/logs/$tagname).\n> \n> Indeed, this proves my inferior intelligence: the update-ref method at \n> least kept as much information as possible in the tag, including the \n> tagger.\n\nMaybe I can salvage a little bit of the \"sapiens\" part in the name of the \nspecies I think I am part of:\n\n-- snip --\n\n git-filter-branch.sh |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 27b57b8..d828a91 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -459,6 +459,10 @@ if [ \"$filter_tag_name\" ]; then\n \t\t\tthen\n \t\t\t\twarn \"gpg signature stripped from tag object $sha1t\"\n \t\t\tfi\n+\t\t\t# make sure the reflogs are written\n+\t\t\tmkdir -p \"$(dirname \"$GIT_DIR/logs/$new_ref\")\" &&\n+\t\t\t>> \"$GIT_DIR/logs/$new_ref\" ||\n+\t\t\tdie \"Could not initialize reflogs for $new_ref\"\n \t\tfi\n \n \t\tgit update-ref \"refs/tags/$new_ref\" \"$new_sha1\" ||\n-- snap --\n\nEric, this is not even compile tested ;-)  But maybe you can start from \nthere?\n\nCiao,\nDscho\n"}]}