{"thread":{"id":"23426","subject":"Is it possible to have a file shared between branches?","startedAt":"2010-04-12T09:10:10Z","lastAt":"2010-04-12T16:10:11Z","messageCount":7,"participants":["Eric LEBIGOT","Ævar Arnfjörð Bjarmason","Wincent Colaiuta","Jakub Narebski","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"139320","messageId":"alpine.OSX.2.01.1004121058390.52293@kroll.spectro.jussieu.fr","threadId":"23426","inReplyTo":null,"subject":"Is it possible to have a file shared between branches?","fromName":"Eric LEBIGOT","fromEmail":"eric.lebigot@normalesup.org","sentAt":"2010-04-12T09:10:10Z","receivedAt":"2010-04-12T09:10:10Z","isPatch":false,"sender":{"key":"eric.lebigot@normalesup.org","avatar":null},"body":"Hello,\n\nIs it possible for git to track a single file that would be shared accross \nbranches?  Case in point: a to-do list file that describes what has to be \ndone in all the branches; it can be convenient to put all the things that \nhave to be done in a single, shared file, while keeping this to-do list in \nsync with the code (so that it lists what has been done, and what remains to \nbe done).  Committing in a branch would in effect also commit the shared file \nin the other branches (another possibility may be to have in effect many \n\"trees\" in a single git directory, with a specific tree for the to-do list).\n\nIs this something git can do?\n\nEOL\n"},{"id":"139321","messageId":"m2p51dd1af81004120233o95640769zb14a63a4bdb29a76@mail.gmail.com","threadId":"23426","inReplyTo":"alpine.OSX.2.01.1004121058390.52293@kroll.spectro.jussieu.fr","subject":"Re: Is it possible to have a file shared between branches?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-04-12T09:33:46Z","receivedAt":"2010-04-12T09:33:46Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Apr 12, 2010 at 09:10, Eric LEBIGOT <Eric.Lebigot@normalesup.org> wrote:\n> Is it possible for git to track a single file that would be shared accross\n> branches?  Case in point: a to-do list file that describes what has to be\n> done in all the branches; it can be convenient to put all the things that\n> have to be done in a single, shared file, while keeping this to-do list in\n> sync with the code (so that it lists what has been done, and what remains to\n> be done).  Committing in a branch would in effect also commit the shared\n> file in the other branches (another possibility may be to have in effect\n> many \"trees\" in a single git directory, with a specific tree for the to-do\n> list).\n>\n> Is this something git can do?\n\nSure. But it doesn't do it automatically. To do it you'd write a\nlittle script to cherry-pick any commit to the TODO across all your\nbranches on commit.\n\nThat's now how I'd do it. I'd just add a TODO submodule or just always\nwork on the TODO in one branch.\n"},{"id":"139322","messageId":"95BBC559-1EDC-4BF8-98A2-05729BFCCA1D@wincent.com","threadId":"23426","inReplyTo":"alpine.OSX.2.01.1004121058390.52293@kroll.spectro.jussieu.fr","subject":"Re: Is it possible to have a file shared between branches?","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2010-04-12T09:36:16Z","receivedAt":"2010-04-12T09:36:16Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 12/04/2010, a las 11:10, Eric LEBIGOT escribió:\n\n> Hello,\n> \n> Is it possible for git to track a single file that would be shared accross branches?  Case in point: a to-do list file that describes what has to be done in all the branches; it can be convenient to put all the things that have to be done in a single, shared file, while keeping this to-do list in sync with the code (so that it lists what has been done, and what remains to be done).  Committing in a branch would in effect also commit the shared file in the other branches (another possibility may be to have in effect many \"trees\" in a single git directory, with a specific tree for the to-do list).\n> \n> Is this something git can do?\n\nNot exactly.\n\nThe way I'd do this is to put that kind of \"meta\" file in a branch of its own.\n\nLook at the git.git repo itself for an example of a repo with a few branches (todo, html, and man) that are independent of the actual development branches (master, maint, next, pu).\n\nCheers,\nWincent\n"},{"id":"139323","messageId":"m3ljctf0hs.fsf@localhost.localdomain","threadId":"23426","inReplyTo":"alpine.OSX.2.01.1004121058390.52293@kroll.spectro.jussieu.fr","subject":"Re: Is it possible to have a file shared between branches?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-04-12T10:07:49Z","receivedAt":"2010-04-12T10:07:49Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Eric LEBIGOT <Eric.Lebigot@normalesup.org> writes:\n\n> Is it possible for git to track a single file that would be shared\n> accross branches?  Case in point: a to-do list file that describes\n> what has to be done in all the branches; it can be convenient to put\n> all the things that have to be done in a single, shared file, while\n> keeping this to-do list in sync with the code (so that it lists what\n> has been done, and what remains to be done).  Committing in a branch\n> would in effect also commit the shared file in the other branches\n> (another possibility may be to have in effect many \"trees\" in a single\n> git directory, with a specific tree for the to-do list).\n> \n> Is this something git can do?\n\nLook how it is done in git.git repository.  If I remember it\ncorrectly, Junio manages separate small repository inside\nnon-versioned Meta/ directory inside git.git checkout, which contains\nTODO list and some scripts to help maintenance (e.g. to help generate\n\"What's in...\" and \"What's cooking...\" emails).  \n\nFor distribution this repository is pushed into independent 'todo'\nbranch in git.git repository.  It doesn't share commits with other\n\"normal\" branches, i.e. 'maint', 'master', 'next', 'pu'.\n\nThe 'todo' branch can be seen e.g. here:\n  http://git.kernel.org/?p=git/git.git;a=shortlog;h=refs/heads/todo\n\nThe history of TODO file can be viewed e.g. here:\n  http://git.kernel.org/?p=git/git.git;a=history;f=TODO;hb=refs/heads/todo\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"139339","messageId":"alpine.OSX.2.01.1004121639230.60420@kroll.spectro.jussieu.fr","threadId":"23426","inReplyTo":"m3ljctf0hs.fsf@localhost.localdomain","subject":"Re: Is it possible to have a file shared between branches?","fromName":"Eric LEBIGOT","fromEmail":"eric.lebigot@normalesup.org","sentAt":"2010-04-12T14:46:11Z","receivedAt":"2010-04-12T14:46:11Z","isPatch":false,"sender":{"key":"eric.lebigot@normalesup.org","avatar":null},"body":"Thank you!  I can see what is done in the git.git repository, thanks to your \npointer, and it looks like I'm trying to get from git.  But how do you create \nand manage such an independent 'todo' branch?  This branch appears on the \nsame level as master, in the pages you gave, but you also mention a \"non \nversioned Meta/ directory\".  Does this mean that the file structure is like \nthe following?\n\n  ./.git\n  Meta/.git\n  Meta/<todo files>\n\nIf yes, how do all branches appear at the same level in \nhttp://git.kernel.org/?p=git/git.git;a=summary ?  If no, how was the 'todo' \nbranch created?  (I would love to have the todo file in the same directory as \nthe rest.)\n\nEOL\n\nOn Mon, 12 Apr 2010, Jakub Narebski wrote:\n\n> Eric LEBIGOT <Eric.Lebigot@normalesup.org> writes:\n>\n>> Is it possible for git to track a single file that would be shared\n>> accross branches?  Case in point: a to-do list file that describes\n>> what has to be done in all the branches; it can be convenient to put\n>> all the things that have to be done in a single, shared file, while\n>> keeping this to-do list in sync with the code (so that it lists what\n>> has been done, and what remains to be done).  Committing in a branch\n>> would in effect also commit the shared file in the other branches\n>> (another possibility may be to have in effect many \"trees\" in a single\n>> git directory, with a specific tree for the to-do list).\n>>\n>> Is this something git can do?\n>\n> Look how it is done in git.git repository.  If I remember it\n> correctly, Junio manages separate small repository inside\n> non-versioned Meta/ directory inside git.git checkout, which contains\n> TODO list and some scripts to help maintenance (e.g. to help generate\n> \"What's in...\" and \"What's cooking...\" emails).\n>\n> For distribution this repository is pushed into independent 'todo'\n> branch in git.git repository.  It doesn't share commits with other\n> \"normal\" branches, i.e. 'maint', 'master', 'next', 'pu'.\n>\n> The 'todo' branch can be seen e.g. here:\n>  http://git.kernel.org/?p=git/git.git;a=shortlog;h=refs/heads/todo\n>\n> The history of TODO file can be viewed e.g. here:\n>  http://git.kernel.org/?p=git/git.git;a=history;f=TODO;hb=refs/heads/todo\n>\n>\n"},{"id":"139349","messageId":"FEC79299-7309-4665-8CD0-10CD0E7EC033@wincent.com","threadId":"23426","inReplyTo":"alpine.OSX.2.01.1004121639230.60420@kroll.spectro.jussieu.fr","subject":"Re: Is it possible to have a file shared between branches?","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2010-04-12T15:06:42Z","receivedAt":"2010-04-12T15:06:42Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 12/04/2010, a las 16:46, Eric LEBIGOT escribió:\n\n> Thank you!  I can see what is done in the git.git repository, thanks to your pointer, and it looks like I'm trying to get from git.  But how do you create and manage such an independent 'todo' branch?  This branch appears on the same level as master, in the pages you gave, but you also mention a \"non versioned Meta/ directory\".  Does this mean that the file structure is like the following?\n> \n> ./.git\n> Meta/.git\n> Meta/<todo files>\n> \n> If yes, how do all branches appear at the same level in http://git.kernel.org/?p=git/git.git;a=summary ?  If no, how was the 'todo' branch created?  (I would love to have the todo file in the same directory as the rest.)\n\nYou can create a parentless branch as explained here:\n\n  http://madduck.net/blog/2007.07.11:creating-a-git-branch-without-ancestry/\n\nCheers,\nWincent\n"},{"id":"139351","messageId":"7vd3y4lkik.fsf@alter.siamese.dyndns.org","threadId":"23426","inReplyTo":"alpine.OSX.2.01.1004121639230.60420@kroll.spectro.jussieu.fr","subject":"Re: Is it possible to have a file shared between branches?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-12T16:10:11Z","receivedAt":"2010-04-12T16:10:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric LEBIGOT <Eric.Lebigot@normalesup.org> writes:\n\n> Thank you!  I can see what is done in the git.git repository, thanks\n> to your pointer, and it looks like I'm trying to get from git.  But\n> how do you create and manage such an independent 'todo' branch?  This\n> branch appears on the same level as master, in the pages you gave, but\n> you also mention a \"non versioned Meta/ directory\".  Does this mean\n> that the file structure is like the following?\n>\n>  ./.git\n>  Meta/.git\n>  Meta/<todo files>\n>\n> If yes, how do all branches appear at the same level in\n> http://git.kernel.org/?p=git/git.git;a=summary ?  If no, how was the\n> todo' branch created?  (I would love to have the todo file in the same\n> directory as the rest.)\n\nThe way this was arranged was simply:\n\n\t$ mkdir Meta\n        $ cd Meta && git init\n        $ do a lot of work that creates files you see on 'todo'\n        $ git commit\n        $ git push k.org:/pub/scm/git/git.git master:todo\n\t$ cd .. ;# back to the primary working tree.\n\nAnd the last step could have been to push into /pub/scm/git/git-todo.git/\niow a separate repository.\n\nThe _only_ reason 'todo' and 'master' live in the same repository is\nbecause I only have write privilege to /pub/scm/git/git.git/ and not at\nthe /pub/scm/git/ level.  Having these unrelated branches in the same\nrepository is nothing to find cool and imitate; I'd recommend not to do it\nif you don't have to.\n\nHaving these unrelated branches published in the same repository helps\ndistribution a bit, but it never helps the use of the contents in these\nbranches.\n"}]}