Re: [PATCH 1/2] Fix git branch -m for symrefs.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Saturday, October 25, 2008 - 11:31 am

Miklos Vajna <vmiklos@frugalware.org> writes:


Two variables flag vs flags is a bit confusing, isn't it?  How about
naming the new one "delopt" or something?

The new variable "char *path" at the toplevel can be confined in the scope
of this if () {} block and probably can become "const char *", right?


Possible bug in the context.  When there is no reflog for the ref being
renamed, lstat would fail; it doesn't feel right to have this S_ISLNK()
before checking the result of the lstat which is in "log".


Do we really need two calls to resolve_ref()?  Your new call calls it
without must-exist bit --- why?  Immediately after that, the existing call
will barf if it does not exist anyway.

I agree it is good to have symref aware delete_ref(), but I am not sure
supporting symref in rename_ref() is either needed or necessarily a good
idea.  You also need to worry about a symref pointing at a branch yet to
be born.

In the meantime, I think we should just check (flag & REF_ISSYMREF) after
the existing resolve_ref() we can see in the context above, and error out
saying you cannot rename a symref, and do nothing else.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Implement git remote mv, Miklos Vajna, (Tue Oct 21, 5:23 pm)
Re: [PATCH] Implement git remote mv, Brandon Casey, (Wed Oct 22, 9:52 am)
[PATCH] Implement git remote mv, Miklos Vajna, (Wed Oct 22, 6:18 pm)
Re: [PATCH] Implement git remote mv, Jeff King, (Wed Oct 22, 8:52 pm)
[PATCH] Implement git remote rename, Miklos Vajna, (Thu Oct 23, 5:56 am)
Re: [PATCH] Implement git remote rename, Junio C Hamano, (Fri Oct 24, 4:33 pm)
[PATCH 1/2] Fix git branch -m for symrefs., Miklos Vajna, (Sat Oct 25, 5:58 am)
[PATCH 2/2] Fix git update-ref --no-deref -d., Miklos Vajna, (Sat Oct 25, 5:58 am)
Re: [PATCH 1/2] Fix git branch -m for symrefs., Junio C Hamano, (Sat Oct 25, 11:31 am)
[PATCH 0/3] symref rename/delete fixes, Miklos Vajna, (Sat Oct 25, 7:33 pm)
[PATCH 1/3] Fix git branch -m for symrefs., Miklos Vajna, (Sat Oct 25, 7:33 pm)
[PATCH 3/3] Fix git update-ref --no-deref -d., Miklos Vajna, (Sat Oct 25, 7:33 pm)
[PATCH] Implement git remote rename, Miklos Vajna, (Mon Nov 3, 11:26 am)
Re: [PATCH] Implement git remote rename, Miklos Vajna, (Mon Nov 10, 1:42 pm)