All of lore.kernel.org
 help / color / mirror / Atom feed
* Is it possible to have a file shared between branches?
@ 2010-04-12  9:10 Eric LEBIGOT
  2010-04-12  9:33 ` Ævar Arnfjörð Bjarmason
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Eric LEBIGOT @ 2010-04-12  9:10 UTC (permalink / raw)
  To: git

Hello,

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).

Is this something git can do?

EOL

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Is it possible to have a file shared between branches?
  2010-04-12  9:10 Is it possible to have a file shared between branches? Eric LEBIGOT
@ 2010-04-12  9:33 ` Ævar Arnfjörð Bjarmason
  2010-04-12  9:36 ` Wincent Colaiuta
  2010-04-12 10:07 ` Jakub Narebski
  2 siblings, 0 replies; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-04-12  9:33 UTC (permalink / raw)
  To: Eric LEBIGOT; +Cc: git

On Mon, Apr 12, 2010 at 09:10, Eric LEBIGOT <Eric.Lebigot@normalesup.org> wrote:
> 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).
>
> Is this something git can do?

Sure. But it doesn't do it automatically. To do it you'd write a
little script to cherry-pick any commit to the TODO across all your
branches on commit.

That's now how I'd do it. I'd just add a TODO submodule or just always
work on the TODO in one branch.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Is it possible to have a file shared between branches?
  2010-04-12  9:10 Is it possible to have a file shared between branches? Eric LEBIGOT
  2010-04-12  9:33 ` Ævar Arnfjörð Bjarmason
@ 2010-04-12  9:36 ` Wincent Colaiuta
  2010-04-12 10:07 ` Jakub Narebski
  2 siblings, 0 replies; 7+ messages in thread
From: Wincent Colaiuta @ 2010-04-12  9:36 UTC (permalink / raw)
  To: Eric LEBIGOT; +Cc: git

El 12/04/2010, a las 11:10, Eric LEBIGOT escribió:

> Hello,
> 
> 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).
> 
> Is this something git can do?

Not exactly.

The way I'd do this is to put that kind of "meta" file in a branch of its own.

Look 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).

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Is it possible to have a file shared between branches?
  2010-04-12  9:10 Is it possible to have a file shared between branches? Eric LEBIGOT
  2010-04-12  9:33 ` Ævar Arnfjörð Bjarmason
  2010-04-12  9:36 ` Wincent Colaiuta
@ 2010-04-12 10:07 ` Jakub Narebski
  2010-04-12 14:46   ` Eric LEBIGOT
  2 siblings, 1 reply; 7+ messages in thread
From: Jakub Narebski @ 2010-04-12 10:07 UTC (permalink / raw)
  To: Eric LEBIGOT; +Cc: git

Eric LEBIGOT <Eric.Lebigot@normalesup.org> writes:

> 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).
> 
> Is this something git can do?

Look how it is done in git.git repository.  If I remember it
correctly, Junio manages separate small repository inside
non-versioned Meta/ directory inside git.git checkout, which contains
TODO list and some scripts to help maintenance (e.g. to help generate
"What's in..." and "What's cooking..." emails).  

For distribution this repository is pushed into independent 'todo'
branch in git.git repository.  It doesn't share commits with other
"normal" branches, i.e. 'maint', 'master', 'next', 'pu'.

The 'todo' branch can be seen e.g. here:
  http://git.kernel.org/?p=git/git.git;a=shortlog;h=refs/heads/todo

The history of TODO file can be viewed e.g. here:
  http://git.kernel.org/?p=git/git.git;a=history;f=TODO;hb=refs/heads/todo

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Is it possible to have a file shared between branches?
  2010-04-12 10:07 ` Jakub Narebski
@ 2010-04-12 14:46   ` Eric LEBIGOT
  2010-04-12 15:06     ` Wincent Colaiuta
  2010-04-12 16:10     ` Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Eric LEBIGOT @ 2010-04-12 14:46 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

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?

  ./.git
  Meta/.git
  Meta/<todo files>

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.)

EOL

On Mon, 12 Apr 2010, Jakub Narebski wrote:

> Eric LEBIGOT <Eric.Lebigot@normalesup.org> writes:
>
>> 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).
>>
>> Is this something git can do?
>
> Look how it is done in git.git repository.  If I remember it
> correctly, Junio manages separate small repository inside
> non-versioned Meta/ directory inside git.git checkout, which contains
> TODO list and some scripts to help maintenance (e.g. to help generate
> "What's in..." and "What's cooking..." emails).
>
> For distribution this repository is pushed into independent 'todo'
> branch in git.git repository.  It doesn't share commits with other
> "normal" branches, i.e. 'maint', 'master', 'next', 'pu'.
>
> The 'todo' branch can be seen e.g. here:
>  http://git.kernel.org/?p=git/git.git;a=shortlog;h=refs/heads/todo
>
> The history of TODO file can be viewed e.g. here:
>  http://git.kernel.org/?p=git/git.git;a=history;f=TODO;hb=refs/heads/todo
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Is it possible to have a file shared between branches?
  2010-04-12 14:46   ` Eric LEBIGOT
@ 2010-04-12 15:06     ` Wincent Colaiuta
  2010-04-12 16:10     ` Junio C Hamano
  1 sibling, 0 replies; 7+ messages in thread
From: Wincent Colaiuta @ 2010-04-12 15:06 UTC (permalink / raw)
  To: Eric LEBIGOT; +Cc: Jakub Narebski, git

El 12/04/2010, a las 16:46, Eric LEBIGOT escribió:

> 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?
> 
> ./.git
> Meta/.git
> Meta/<todo files>
> 
> 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.)

You can create a parentless branch as explained here:

  http://madduck.net/blog/2007.07.11:creating-a-git-branch-without-ancestry/

Cheers,
Wincent

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Is it possible to have a file shared between branches?
  2010-04-12 14:46   ` Eric LEBIGOT
  2010-04-12 15:06     ` Wincent Colaiuta
@ 2010-04-12 16:10     ` Junio C Hamano
  1 sibling, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2010-04-12 16:10 UTC (permalink / raw)
  To: Eric LEBIGOT; +Cc: Jakub Narebski, git

Eric LEBIGOT <Eric.Lebigot@normalesup.org> writes:

> 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?
>
>  ./.git
>  Meta/.git
>  Meta/<todo files>
>
> 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.)

The way this was arranged was simply:

	$ mkdir Meta
        $ cd Meta && git init
        $ do a lot of work that creates files you see on 'todo'
        $ git commit
        $ git push k.org:/pub/scm/git/git.git master:todo
	$ cd .. ;# back to the primary working tree.

And the last step could have been to push into /pub/scm/git/git-todo.git/
iow a separate repository.

The _only_ reason 'todo' and 'master' live in the same repository is
because I only have write privilege to /pub/scm/git/git.git/ and not at
the /pub/scm/git/ level.  Having these unrelated branches in the same
repository is nothing to find cool and imitate; I'd recommend not to do it
if you don't have to.

Having these unrelated branches published in the same repository helps
distribution a bit, but it never helps the use of the contents in these
branches.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-12 16:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-12  9:10 Is it possible to have a file shared between branches? Eric LEBIGOT
2010-04-12  9:33 ` Ævar Arnfjörð Bjarmason
2010-04-12  9:36 ` Wincent Colaiuta
2010-04-12 10:07 ` Jakub Narebski
2010-04-12 14:46   ` Eric LEBIGOT
2010-04-12 15:06     ` Wincent Colaiuta
2010-04-12 16:10     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.