Re: [PATCH 1/2] sha1_name: fix error message for @{u}

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/2] sha1_name: fix error message for @{u}

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:23

Ramkumar Ramachandra [off-list ref] writes:
Ramkumar Ramachandra wrote:
quoted
Junio C Hamano wrote:
quoted
So did you or did you not audit the codepath?
No; I was explaining why I didn't in the first place.  Going through it now.
So, this is what I have:

interpret_branch_name -> interpret_branch_name (recursion)
                      -> get_sha1_basic -> get_sha1 [context] (end-user data)
                      -> substitute_branch_name -> dwim (end-user data)
		      -> strbuf_branchname (callers pass a branch name; no @{u})
		      -> revision.c:add_pending_object [with_mode] (end-user data)

[die_]verify_filename -> builtin/rev-parse.c (end-user)
		      -> builtin/reset.c (end-user)
		      -> builtin/grep.c:cmd_grep (end-user)
		      -> revision.c:setup_revisions (end-user data)
It seems that you are digging in the wrong direction?  I was worried
about the callers of interpret_branch_name().

But whatever.

I looked at the callers myself while waiting for the test suite to
pass for five integration branches and I think the patch is safe.
There were some silent error returns from the function but your
patch did not touch them (which is good).
We used to die in die_verify_filename() earlier, but we die in
interpret_branch_name() after the patch.
I think that is a desired outcome.  Thanks.

Re: [PATCH 1/2] sha1_name: fix error message for @{u}

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:23

Junio C Hamano wrote:
quoted
interpret_branch_name -> interpret_branch_name (recursion)
                      -> get_sha1_basic -> get_sha1 [context] (end-user data)
                      -> substitute_branch_name -> dwim (end-user data)
                    -> strbuf_branchname (callers pass a branch name; no @{u})
                    -> revision.c:add_pending_object [with_mode] (end-user data)

[die_]verify_filename -> builtin/rev-parse.c (end-user)
                    -> builtin/reset.c (end-user)
                    -> builtin/grep.c:cmd_grep (end-user)
                    -> revision.c:setup_revisions (end-user data)
It seems that you are digging in the wrong direction?  I was worried
about the callers of interpret_branch_name().
Um, aren't interpret_branch_name, get_sha1_basic,
substitute_branch_name, strbuf_branchname, and add_pending_object the
five callers of interpret_branch_name?  I've tried to show how they
are called with either end-user data or programmatic data without a
"@{u}".  What am I missing?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help