git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linux@horizon.com
To: git@vger.kernel.org, torvalds@osdl.org
Cc: linux@horizon.com
Subject: Re: Missing features in git
Date: 14 Nov 2006 16:38:00 -0500	[thread overview]
Message-ID: <20061114213800.28716.qmail@science.horizon.com> (raw)
In-Reply-To: <20061114195559.40967ee4.froese@gmx.de>

>>> Another solution would be to be able to put non-head ref in HEAD,
>>> but allow to commit only if the prefix is refs/heads/
>> 
>> That's not a bad idea.  Then you can checkout a tag and have
>> 'ref: refs/tags/v1.11' in HEAD, which means anyone who puts
>> $(git-symbolic-ref) calls into their PS1 will see "refs/tags/v1.11"
>> as their current branch, reminding them they are looking at the past.

> I agree. This would probably be a good way to do "read-only branches".
> 
> Allowing people to do a "git checkout" on anything committish, but then 
> not allowing them to commit to that, is probably the right thing to do.
> 
> Together with a nice readable error message from "git commit" (and merge, 
> and pull - although you might well allow "fetch" to update the thing that 
> current HEAD points to, though), this would be a lot easier to use for 
> people who just follow somebody elses branch.

This certainly seems like a popular idea.  I think the vote is to symlink
(symref) to a non-refs/heads/ object if possible, but allow an arbitrary
object ID as well.  In either case, commits would be forbidden.

The only reason I had avoided symlinking before was in case the tag was
deleted, but that can be fixed easily enough.  (Either make git-tag -d/-f
fail, or have it replace the HEAD symref with a raw hex object.
Actually, you could do the same with git branch -d.  Any opinions?)

I can try to write the patch if there are no better volunteers, although
it'll take me a lot longer that someone more comfortable with the code.

Um.. for example, I'm not sure what the git fetch problem could
possibly be.  It only updates heads, no?  Or are you thinking
of the new refs/remotes thing that I'm not familiar with?

I'll have to examine the callers of git-symbolic-ref to see what
it should do.  Return the hex object ID and fail are the obvious
possibilities.


Note that NOT having any sort of bisect label (and just using HEAD
itself as a raw pointer) solves the "git reset --hard" problem; I can
"git checkout HEAD^" and have debug hacks preserved.

It also removes a paragraph of excuses from some "using git" docs
I'm writing.  It's a lot easier to explain why you can't commit
if you're not on a branch than to explain why you can't not be
on a branch.

Oh, and as I mentioned, not that "git checkout -b <newbranch>" is
exactly painful, but I think a "-b <newbranch>" option to git-commit
would be a convenience.  (An interesting question is whether it should
create the new branch even if there is nothing to.  I'm thinking "yes"

  reply	other threads:[~2006-11-14 21:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 13:49 Missing features in git linux
2006-11-14 14:53 ` Jakub Narebski
2006-11-14 15:47   ` Karl Hasselström
2006-11-14 17:15     ` Jakub Narebski
2006-11-14 17:36       ` Karl Hasselström
2006-11-14 17:45         ` Jakub Narebski
2006-11-14 17:49           ` Shawn Pearce
2006-11-14 18:40             ` Linus Torvalds
2006-11-14 19:37               ` Petr Baudis
2006-11-14 22:09               ` Junio C Hamano
2006-11-14 15:39 ` Karl Hasselström
2006-11-14 18:55 ` Edgar Toernig
2006-11-14 21:38   ` linux [this message]
2006-11-15  7:35     ` Karl Hasselström
2006-11-15 16:50       ` Linus Torvalds
2006-11-14 22:13 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061114213800.28716.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).