diff options
author | Junio C Hamano <junkio@cox.net> | 2007-01-01 23:31:08 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-01-08 03:02:11 -0800 |
commit | c847f537125ceab3425205721fdaaa834e6d8a83 (patch) | |
tree | ff9d242fe9d7bd4008f16d7f43e860e0db861981 /cache.h | |
parent | 0016a48251abefed11efc919703d980a21c95f2c (diff) | |
download | git-c847f537125ceab3425205721fdaaa834e6d8a83.tar.gz git-c847f537125ceab3425205721fdaaa834e6d8a83.tar.xz |
Detached HEAD (experimental)
This allows "git checkout v1.4.3" to dissociate the HEAD of
repository from any branch. After this point, "git branch"
starts reporting that you are not on any branch. You can go
back to an existing branch by saying "git checkout master", for
example.
This is still experimental. While I think it makes sense to
allow commits on top of detached HEAD, it is rather dangerous
unless you are careful in the current form. Next "git checkout
master" will obviously lose what you have done, so we might want
to require "git checkout -f" out of a detached HEAD if we find
that the HEAD commit is not an ancestor of any other branches.
There is no such safety valve implemented right now.
On the other hand, the reason the user did not start the ad-hoc
work on a new branch with "git checkout -b" was probably because
the work was of a throw-away nature, so the convenience of not
having that safety valve might be even better. The user, after
accumulating some commits on top of a detached HEAD, can always
create a new branch with "git checkout -b" not to lose useful
work done while the HEAD was detached.
We'll see.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -299,7 +299,7 @@ extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */ extern int read_ref(const char *filename, unsigned char *sha1); extern const char *resolve_ref(const char *path, unsigned char *sha1, int, int *); extern int create_symref(const char *ref, const char *refs_heads_master); -extern int validate_symref(const char *ref); +extern int validate_headref(const char *ref); extern int base_name_compare(const char *name1, int len1, int mode1, const char *name2, int len2, int mode2); extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2); |