On Oct 28, 2007, at 8:28 AM, Junio C Hamano wrote:
Steffen Prohaska <prohaska@xxxxxx> writes:
"git rev-parse --symbolic" used to return the ref name as it was
specified on the command line. This is changed to returning the
full matched ref name, i.e. "git rev-parse --symbolic master"
now typically returns "refs/heads/master".
This is to expose "dwim_ref" logic, so it might be a good idea
to introduce a new option --dwim-ref for this purpose.
git rev-parse --symbolic master^2
is designed to give "master^2" or fail if "master" is not a
merge.
So the idea of --symbolic is really to return the argv as is?
No change whatsoever allowed. Why would someone need this?
Is it only for convenience when writing shell code?
Similarly, you would diagnose a failure if somebody asks
to show
git rev-parse --dwim-ref master~4
instead of giving "refs/heads/master~4".
What I proposed is to teach git rev-parse to return a full
symbolic ref name. Maybe
git rev-parse --full-symbolic
git rev-parse --full-ref
But honestly, I don't care that much about this patch. Maybe
we just put it aside?
+static void show_rev(int type, const unsigned char *sha1, const
char *name, const char* real_name)
@@ -131,7 +133,7 @@ static void show_default(void)
def = NULL;
if (!get_sha1(s, sha1)) {
- show_rev(NORMAL, sha1, s);
+ show_rev(NORMAL, sha1, s, 0);
A null pointer constant in git sources is spelled "NULL" not "0".
Ok. I'll fix this in all patches.
@@ -213,6 +215,7 @@ int cmd_rev_parse(int argc, const char **argv,
const char *prefix)
{
int i, as_is = 0, verify = 0;
unsigned char sha1[20];
+ char* real_name = 0;
Pointer sign '*' in git sources go next to the name not the
type, as:
char *real_name = NULL;
I know and I tried hard to follow this convention, although
I think its the wrong choice ;)
Steffen
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html