{"thread":{"id":"32937","subject":"Feature idea : notes to track status of a commit, which remotes it is shared to","startedAt":"2013-02-19T09:38:09Z","lastAt":"2013-02-19T18:55:15Z","messageCount":5,"participants":["Mildred Ki'Lya","Thomas Rast","W. Trevor King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"209793","messageId":"51234801.5050208@mildred.fr","threadId":"32937","inReplyTo":null,"subject":"Feature idea : notes to track status of a commit, which remotes it is shared to","fromName":"Mildred Ki'Lya","fromEmail":"mildred-ml@mildred.fr","sentAt":"2013-02-19T09:38:09Z","receivedAt":"2013-02-19T09:38:09Z","isPatch":false,"sender":{"key":"mildred-ml@mildred.fr","avatar":null},"body":"Hi,\n\nThis is my first time on this list (and by the way, I'm not subscribed, \nso please Cc me to the replies). I have an idea that could be useful to \nmake rewriting history safer and easier to new users (I'm training some \nof them). I thought I could share this idea, but perhaps someone already \nthought about it. And I'm not providing code.\n\nThe idea is to basically track automatically (in notes, either in the \nnotes namespace or in another namespace) which repository/remote \ncontains a commit. When doing git log, we'd see lines with each commit, \nsomething like:\n\n\n\ncommit b044e6d0f1a1782820b052348ab0db314e2db3ca\nAuthor: Myself <myself@localhost.localdomain>\nDate:   Tue Nov 20 16:46:38 2012 +0100\n\n     This is the commit description\n\nPublished on:\n     origin\n     git@git.host.com:pub/repo.git\n\n\nThen, we could have all the history rewriting commands (such as rebase \nor pull --rebase) die when rewriting commits that are already published \nanywhere. We could make an exception for a --force/-f flag or \nconfiguration option, or commits published in another local repository \nowned by the same user.\n\nIn most setups, it could be useful to tell users they can safely rebase \nwithout worrying about published commits as Git is tracking it for them. \nOf course this is not an absolute security, but it's a good start.\n\nWhat do you think?\n\nMildred\n"},{"id":"209799","messageId":"87bobgtxvk.fsf@pctrast.inf.ethz.ch","threadId":"32937","inReplyTo":"51234801.5050208@mildred.fr","subject":"Re: Feature idea : notes to track status of a commit, which remotes it is shared to","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2013-02-19T10:13:19Z","receivedAt":"2013-02-19T10:13:19Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Mildred Ki'Lya <mildred-ml@mildred.fr> writes:\n\n> The idea is to basically track automatically (in notes, either in the\n> notes namespace or in another namespace) which repository/remote\n> contains a commit. When doing git log, we'd see lines with each\n> commit, something like:\n>\n> commit b044e6d0f1a1782820b052348ab0db314e2db3ca\n> Author: Myself <myself@localhost.localdomain>\n> Date:   Tue Nov 20 16:46:38 2012 +0100\n>\n>     This is the commit description\n>\n> Published on:\n>     origin\n>     git@git.host.com:pub/repo.git\n\nThe problem here is that doing this in notes is unreliable: you'd have\nto identify all places where the set of \"publishes\" can change for any\ncommit, and update them there.\n\nIt's much easier, if a bit slower, to just run\n\n  git branch -r --contains $commit\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"209801","messageId":"20130219103042.GA4565@odin.tremily.us","threadId":"32937","inReplyTo":"51234801.5050208@mildred.fr","subject":"Re: Feature idea : notes to track status of a commit, which remotes it is shared to","fromName":"W. Trevor King","fromEmail":"wking@tremily.us","sentAt":"2013-02-19T10:30:42Z","receivedAt":"2013-02-19T10:30:42Z","isPatch":false,"sender":{"key":"wking@tremily.us","avatar":"https://avatars.githubusercontent.com/u/209920?v=4"},"body":"On Tue, Feb 19, 2013 at 10:38:09AM +0100, Mildred Ki'Lya wrote:\n> Then, we could have all the history rewriting commands (such as\n> rebase or pull --rebase) die when rewriting commits that are already\n> published anywhere. We could make an exception for a --force/-f flag\n> or configuration option, or commits published in another local\n> repository owned by the same user.\n\nYou might want to look into extending the sample pre-rebase hook,\nwhich prevents topic branches that are already merged to 'next' branch\nfrom getting rebased.  You'd just have to loop over all remote\nreferences instead of only checking the local 'next' branch.\n\n-- \nThis email may be signed or encrypted with GnuPG (http://www.gnupg.org).\nFor more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\n"},{"id":"209802","messageId":"20130219103453.GB4565@odin.tremily.us","threadId":"32937","inReplyTo":"20130219103042.GA4565@odin.tremily.us","subject":"Re: Feature idea : notes to track status of a commit, which remotes it is shared to","fromName":"W. Trevor King","fromEmail":"wking@tremily.us","sentAt":"2013-02-19T10:34:53Z","receivedAt":"2013-02-19T10:34:53Z","isPatch":false,"sender":{"key":"wking@tremily.us","avatar":"https://avatars.githubusercontent.com/u/209920?v=4"},"body":"On Tue, Feb 19, 2013 at 11:13:19AM +0100, Thomas Rast wrote:\n> It's much easier, if a bit slower, to just run\n> \n>   git branch -r --contains $commit\n\nAh, this would be better than looping in your hook ;).\n\n-- \nThis email may be signed or encrypted with GnuPG (http://www.gnupg.org).\nFor more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\n"},{"id":"209850","messageId":"7vsj4s5e24.fsf@alter.siamese.dyndns.org","threadId":"32937","inReplyTo":"87bobgtxvk.fsf@pctrast.inf.ethz.ch","subject":"Re: Feature idea : notes to track status of a commit, which remotes it is shared to","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-19T18:55:15Z","receivedAt":"2013-02-19T18:55:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> Mildred Ki'Lya <mildred-ml@mildred.fr> writes:\n>\n>> The idea is to basically track automatically (in notes, either in the\n>> notes namespace or in another namespace) which repository/remote\n>> contains a commit. When doing git log, we'd see lines with each\n>> commit, something like:\n>>\n>> commit b044e6d0f1a1782820b052348ab0db314e2db3ca\n>> Author: Myself <myself@localhost.localdomain>\n>> Date:   Tue Nov 20 16:46:38 2012 +0100\n>>\n>>     This is the commit description\n>>\n>> Published on:\n>>     origin\n>>     git@git.host.com:pub/repo.git\n>\n> The problem here is that doing this in notes is unreliable: you'd have\n> to identify all places where the set of \"publishes\" can change for any\n> commit, and update them there.\n\nUnreliable you can fix with effort.\n\nBut I think a bigger problem is that it is a pointless \"false\neconomy\" to attempt to record and try to maintain this note for each\nand every commit.\n\nWhen you push out a tip of the branch to a new location, you would\nhave to update notes to all commits from that tip down to where in\nthe history to record that new location?  To the root?  Also your\nupstream may fetch from your published place and you may fetch it\nback (you will notice that now the commit appears in your 'origin').\nWould you do the traversal and update all notes?\n\nIt is both much easier and cheaper to compute this on demand as you\npointed out.\n"}]}