Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Re: [jgit-dev] RFC: How to display "detached" HEAD in Git Label Decorations

måndagen den 10 maj 2010 20.26.05 skrev  Shawn O. Pearce:
> Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> wrote:
> > måndagen den 10 maj 2010 09.23.13 skrev  Kinzler, Mathias:
> > > If a remote branch or a tag is checked out, HEAD becomes "detached",
> > > i.e. it does not point to a local branch, but to a commit. In msysgit,
> > > the shell outputs some lengthy note and the prompt changes to either
> > > the shortened commit id with ellipsis in parentheses (in the case of a
> > > remote branch) or to the tag name in parentheses (in the case of a
> > > tag). In Egit, however, we always see the shortened branch name
> > > (without ellipsis) in the project label decoration (and it is
> > > shortened to just six characters instead of seven as in msysgit).
> > > 
> > > How about changing EGit in such a way as to
> > > 
> > > 1.      Show the shortened commit id with seven chars and followed by
> > > ellipsis (both for remote branches and tags) 2.      Add the tag name
> > > or the remote branch name after the shortened commit id, respectively
> > > if such a tag or remote branch can be found
> > > 
> > > So the default label decoration for a project could look like:
> > > 
> > > <some.project.name> [repositoryname master]-------local branch "master"
> > > checked out <some.project.name> [repositoryname abcdxyz...
> > > (remotes/origin/master)]-------remote branch "origin/master" checked
> > > out, commit abcdxyz... <some.project.name> [repositoryname xyzabcd...
> > > (tags/v0.1.3)]-------tag "v0.1.3" checked out, commit xyzabcd...
> > > 
> > > Does this make sense?
> > 
> > I'd suggest you do what git describe does,
> > 
> > [me@sleipner jgit ((0df679a...)|BISECTING)]$ git describe
> > v0.7.1-50-g0df679a
> 
> git describe?  Or the bash completion and its __git_ps1 function?
> Because I think the label he is talking about in EGit is much more
> like the __git_ps1 function than it is like describe.

I was thinking about git describe since the suggestion above was about using a 
ref name. git describe does thar and we might want to do like it does rather 
than invent a slightly different scheme. Unlike the bash prompt EGit can cache
the result of the expensive computation.

-- robin


Back to the top