* Re: git branch descriptions
2010-05-10 23:26 ` Jonathan Nieder
@ 2010-05-11 1:16 ` Geert Bosch
2010-05-11 12:38 ` Joel Reed
2010-05-11 7:44 ` Michael J Gruber
2010-05-11 12:33 ` Joel Reed
2 siblings, 1 reply; 10+ messages in thread
From: Geert Bosch @ 2010-05-11 1:16 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Joel Reed, git@vger.kernel.org, Ramkumar Ramachandra
On May 10, 2010, at 19:26, Jonathan Nieder wrote:
> I think the closest thing we have now is ‘git branch -v’, which tells
> the subject of the commit at the tip of the branch. ‘git notes’
> annotates commits rather than branches, so it occupies a different
> niche.
Indeed, I've not started to use the -v flag a lot more and wish
it were default. However, when I started to think about attaching
descriptions or any other information to branches, I started
to realize what we'd lose with that.
>
> Your request is a reasonable one, and it has come up a few times in
> different forms over the years:
>
> . per-branch descriptions in .git/description[1]
> . per-branch descriptions in .git/config[2][3]
> . README branch whose files describe the branches[4]
>
> Number [2] is my preferred choice (and comes with code!), for what
> it’s worth.
The question is what you'd do with these when moving branches around.
You could move the descriptions with the branches, though that would be
a bit ugly implementation-wise: I don't quite like the idea of programs
rewriting configuration files as part of regular operation.
Besides that, I find my self often use a workflow like:
% git checkout -b newtopic
% (hack, commit, hack, commit, ...)
% git log
% (oops, better fix up those revision histories)
% git checkout -b newtopic-fixup newtopic~2
% git cherry-pick newtopic~1 ; git commit --amend ; rinse ; repeat
% (ok, finished, pretend the old stuff never happened)
% git branch -M newtopic
If branches were more than just a way of naming a place to
put commits, it would be getting much more heaving to do this
kind of thing.
The other approach, of leaving them in place wouldn't be much
more appealing either.
It seems if we'd do branch descriptions at all, their main use
would be fore remote repositories. When you publish a branch,
you'd typically not rewrite it on a whim, so attaching a description
makes sense. Similarly, if you're tracking a remote repository,
it would be helpful to get some information for the branch.
For local repositories, I have been amazed how useful the git branch -v is.
And it comes for free, no need to enter any data!
Regards,
-Geert
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: git branch descriptions
2010-05-11 1:16 ` Geert Bosch
@ 2010-05-11 12:38 ` Joel Reed
0 siblings, 0 replies; 10+ messages in thread
From: Joel Reed @ 2010-05-11 12:38 UTC (permalink / raw)
To: Geert Bosch, Jonathan Nieder; +Cc: git@vger.kernel.org, Ramkumar Ramachandra
Geert Bosch wrote:
<snip>
> It seems if we'd do branch descriptions at all, their main use
> would be fore remote repositories. When you publish a branch,
> you'd typically not rewrite it on a whim, so attaching a description
> makes sense. Similarly, if you're tracking a remote repository,
> it would be helpful to get some information for the branch.
For my usage, I have to strongly disagree! I _primarily_ wish I could add a description to LOCAL branches.
jr
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git branch descriptions
2010-05-10 23:26 ` Jonathan Nieder
2010-05-11 1:16 ` Geert Bosch
@ 2010-05-11 7:44 ` Michael J Gruber
2010-05-11 12:39 ` Joel Reed
2010-05-11 12:33 ` Joel Reed
2 siblings, 1 reply; 10+ messages in thread
From: Michael J Gruber @ 2010-05-11 7:44 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Joel Reed, git@vger.kernel.org, Ramkumar Ramachandra
Jonathan Nieder venit, vidit, dixit 11.05.2010 01:26:
> Hi,
>
> Joel Reed wrote:
>
>> Working on a wide range of topics/branches from week to week and
>> project to project, it's sometimes difficult to quickly remember
>> what each branch is about, without doing a git diff master <branch>.
>> I like to keep branch names short so they're easy to switch to and
>> from, but being able to attach a description that would display when
>> doing a "git branch" would be a huge help.
>
> I think the closest thing we have now is ‘git branch -v’, which tells
> the subject of the commit at the tip of the branch. ‘git notes’
> annotates commits rather than branches, so it occupies a different
> niche.
>
> Your request is a reasonable one, and it has come up a few times in
> different forms over the years:
>
> . per-branch descriptions in .git/description[1]
> . per-branch descriptions in .git/config[2][3]
> . README branch whose files describe the branches[4]
>
> Number [2] is my preferred choice (and comes with code!), for what
> it’s worth.
>
> That doesn’t address the problem of how to _share_ branch
> descriptions. That could be dealt with by extending the wire protocol
> as in [1], I think. Just sharing a list of branch descriptions is a
> bad idea imho, since related repositories need to be able to name
> their branches independently to avoid painful coordination problems.
I have a mostly working idea (working when done "manually") on how to
use notes for that. As we, know, we can share notes without overriding
our own notes (and improving the merge/combine facilities would benefit
all note users). I'll try to come up with a proof-of-concept patch, but
probably not before next week.
Michael
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: git branch descriptions
2010-05-11 7:44 ` Michael J Gruber
@ 2010-05-11 12:39 ` Joel Reed
0 siblings, 0 replies; 10+ messages in thread
From: Joel Reed @ 2010-05-11 12:39 UTC (permalink / raw)
To: Michael J Gruber, Jonathan Nieder
Cc: git@vger.kernel.org, Ramkumar Ramachandra
Michael J Gruber wrote:
<snip>
> > Your request is a reasonable one, and it has come up a few times in
> > different forms over the years:
> >
> > . per-branch descriptions in .git/description[1]
> > . per-branch descriptions in .git/config[2][3]
> > . README branch whose files describe the branches[4]
> >
> > Number [2] is my preferred choice (and comes with code!), for what
> > it’s worth.
> >
> > That doesn’t address the problem of how to _share_ branch
> > descriptions. That could be dealt with by extending the wire protocol
> > as in [1], I think. Just sharing a list of branch descriptions is a
> > bad idea imho, since related repositories need to be able to name
> > their branches independently to avoid painful coordination problems.
>
> I have a mostly working idea (working when done "manually") on how to
> use notes for that. As we, know, we can share notes without overriding
> our own notes (and improving the merge/combine facilities would benefit
> all note users). I'll try to come up with a proof-of-concept patch, but
> probably not before next week.
Sounds awesome! If I can help test in anyway please let me know.
jr
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: git branch descriptions
2010-05-10 23:26 ` Jonathan Nieder
2010-05-11 1:16 ` Geert Bosch
2010-05-11 7:44 ` Michael J Gruber
@ 2010-05-11 12:33 ` Joel Reed
2 siblings, 0 replies; 10+ messages in thread
From: Joel Reed @ 2010-05-11 12:33 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git@vger.kernel.org, Ramkumar Ramachandra
Jonathan Nieder wrote:
> > Working on a wide range of topics/branches from week to week and
> > project to project, it's sometimes difficult to quickly remember
> > what each branch is about, without doing a git diff master <branch>.
> > I like to keep branch names short so they're easy to switch to and
> > from, but being able to attach a description that would display when
> > doing a "git branch" would be a huge help.
>
> I think the closest thing we have now is ‘git branch -v’, which tells
> the subject of the commit at the tip of the branch. ‘git notes’
> annotates commits rather than branches, so it occupies a different
> niche.
I'm more looking for the description of the branch, not the last commit, but I did not know about this option and will give it a try. Thanks for the tip!
> Your request is a reasonable one, and it has come up a few times in
> different forms over the years:
>
> . per-branch descriptions in .git/description[1]
> . per-branch descriptions in .git/config[2][3]
> . README branch whose files describe the branches[4]
>
> Number [2] is my preferred choice (and comes with code!), for what
> it’s worth.
My number one need is just to be able to add a description to local branches so I don't forget why I made them weeks later.
I have noticed when browsing around on gitweb/github looking at available branches that I sometimes wish I knew a bit more about the branch as well so I can see the need to see remote descriptions as well. Sharing the descriptions isn't of much interest to me personally.
jr
^ permalink raw reply [flat|nested] 10+ messages in thread