All of lore.kernel.org
 help / color / mirror / Atom feed
* 2 things about branches
@ 2007-02-19 18:13 Raimund Bauer
  2007-02-19 18:37 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Raimund Bauer @ 2007-02-19 18:13 UTC (permalink / raw)
  To: git

I think it's a good idea to not list remote branches in 'git branch'
output per default, but imho we should make an exception for the branch
the user is currently on.
Currently when I do 'git checkout origin/next' the checkout works fine
and I get the warning about the remote branch, but an informational
query 'git branch' right after that says

* (no branch)
  master

'git branch -r' also doesn't mark me as being on origin/next.
Maybe we could query the remote-branches for a matching ref this case?

And another wish about branches:
After a fresh clone of git, my .git/config contains a section

[branch "master"]
        remote = origin
        merge = refs/heads/master

so it's easy to keep the branch updated by just saying 'git pull' when
on branch master.

Doing 'git checkout -b next origin/next' gives me my own next-branch,
but short of editing .git/config there seems to be no way to get a
similar section [branch "next"] ... so I can follow next as easy as
master.
I'm not sure if there exists a sane default we could use automatically,
but maybe a switch to git-checkout to write a config entry would be
possible?

Thanks for listening to my rambling

-- 
best regards

  Ray

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

* Re: 2 things about branches
  2007-02-19 18:13 2 things about branches Raimund Bauer
@ 2007-02-19 18:37 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2007-02-19 18:37 UTC (permalink / raw)
  To: Raimund Bauer; +Cc: git

On Mon, Feb 19, 2007 at 07:13:59PM +0100, Raimund Bauer wrote:
> I think it's a good idea to not list remote branches in 'git branch'
> output per default, but imho we should make an exception for the branch
> the user is currently on.
> Currently when I do 'git checkout origin/next' the checkout works fine
> and I get the warning about the remote branch, but an informational
> query 'git branch' right after that says
> 
> * (no branch)
>   master
> 
> 'git branch -r' also doesn't mark me as being on origin/next.

That's because you're not really "on" origin/next.  Your currently
checked-out state happens to be the same as the state that origin/next
points at, but that's not quite the same thing.  The main difference
being that if you commit something, origin/next won't be moved forward
to point at the new commit.

> Maybe we could query the remote-branches for a matching ref this case?

If that's what you want you could use e.g.

	git describe --all

--b.

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

end of thread, other threads:[~2007-02-19 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 18:13 2 things about branches Raimund Bauer
2007-02-19 18:37 ` J. Bruce Fields

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.