git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linux@horizon.com
To: git@vger.kernel.org
Cc: linux@horizon.com
Subject: Missing features in git
Date: 14 Nov 2006 08:49:58 -0500	[thread overview]
Message-ID: <20061114134958.5326.qmail@science.horizon.com> (raw)

I've been writing some more git docs, and I came across a few
things git does that I'm not sure are desirable.


One thing I noticed is that with ref logs, you've just re-invented the
CVS problem of associating history with a name.  If you want to rename
a branch (say, from "mischacks" to something suitable for publication),
do you rename the log or not?  It's a less virulent form, but it seems
like the same disease.

Another minor quibble: AFAICT, "git checkout -f -m" is meaningless (-f
overrides -m), but doesn't complain.


One feature that I noticed is missing, is that there's no easy way to do a
"git reset --hard" while doing a "git checkout" style merge.

An example of when you'd want to do this is performing a "git bisect"
with a local "#define DEBUG 1" change.  Particularly if you
hit a non-compiling version and need to back up.

  
The only way to do this currently is somethig like:
        git checkout -b temp HEAD^
        git branch -f bisect temp
        git checkout bisect
        git branch -d temp

or the way git-bisect does it
  
        echo "$rev" > "$GIT_DIR/refs/heads/new-bisect"
        git checkout new-bisect || exit
        mv "$GIT_DIR/refs/heads/new-bisect" "$GIT_DIR/refs/heads/bisect" &&
        GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD refs/heads/bisect
  
Either way, it reserves a second branch name, and seems like a bit of
a hack.  I'm already a bit annoyed that "bisect" is reserved but not
clearly documented as such, and note that the branch name "new-bisect",
which we are switched to temporarily, does not match the pattern
"refs/heads/bisect*" that bisect_start checks for.

The only thing I don't know is if this should be a git-checkout
option or a git-reset option.  The former shares far more code,
but the latter might make more logical sense.

  
Personally, I'd prefer if the requirement that HEAD point to
refs/heads were enforced when checking in rather than checking out.
  
Then you could check out an arbitrary version without any of the annoyance
above; I could "git checkout tags/foo" or even "git checkout deadbeef~3".
I wouldn't be on a current branch (which would necessitate changing
"git branch" output), so HEAD would simply contain an object ID directly
rather than being a symlink/symref.

It's a bit of a PITA auditing the code base to find everywhere affected
by changing this invariant, but it doesn't conceptually difficult.
Is there anything fundamental that this would break?


The above would make a "-b <newbranch>" option to git-commit more useful,
but it's not a half-bad idea as it is.  It's just one extra command
(git checkout -b newbranch; git commit), but it takes a bit of
thinking to realize that "git checkout", which normally modifies the
working directory, won't touch your ready-to-be-committed changes in

             reply	other threads:[~2006-11-14 13:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 13:49 linux [this message]
2006-11-14 14:53 ` Missing features in git 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
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=20061114134958.5326.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=git@vger.kernel.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).