Thread (3 messages) 3 messages, 3 authors, 2016-06-15

Re: [PATCH] filter-branch: add passed/remaining seconds on progress

From: Jeff King <hidden>
Date: 2016-06-15 23:06:29

Possibly related (same subject, not in this thread)

On Tue, Sep 08, 2015 at 10:32:12AM -0700, Junio C Hamano wrote:
Also git_filter_branch__commit_count is now used only inside this
function, so it is easier to follow to increment it here.

I suspect that the variable has this unwieldy name for historic
reasons, perhaps an attempt to avoid name clashes with the end user
script, but it has many variables (e.g. $commits, $ref, etc.) that
are way too generic and that I can see no attempt of name clash
avoidance, so renaming it to $total_commits or something _might_
make some sense.
I briefly wondered if it had the opposite reason; could it have a
well-defined name because it is meant to be a public value the
user-defined shell snippets can access?

But it is not documented, and I can imagine that "the current count" is
not really useful without "total number of commits", so in practice I
doubt anybody's filter branch script is relying on it.

And looking through the history turns up d5b0c97 (git-filter-branch:
avoid collisions with variables in eval'ed commands, 2009-03-25), which
seems fairly clear. :)

The original name was "i", which I think is probably too short. Calling
it something meaningful but longer than one character is probably
sufficient.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help