Re: obsolete index in wt_status_print after pre-commit hook runs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 15.07.2016 um 5:19 nachm. schrieb Junio C Hamano <gitster@xxxxxxxxx>:
> 
> On Fri, Jul 15, 2016 at 1:30 PM, Andrew Keller <andrew@xxxxxxxxxxxxxx> wrote:
>> Am 15.07.2016 um 12:34 nachm. schrieb Andrew Keller <andrew@xxxxxxxxxxxxxx>:
>> 
>>> I pulled out the source for version 2.9.1 and briefly skimmed how run_commit and
>>> prepare_to_commit work.  It seems that Git already understands that a pre-commit
>>> hook can change the index, and it rereads the index before running the
>>> prepare-commit-msg hook: https://github.com/git/git/blob/v2.9.1/builtin/commit.c#L941-L951
>> 
>> Quick question: Why does Git reread the index after the pre-commit hook runs?
> 
> Offhand I do not think of a good reason to do so; does something break
> if you took it out?

According to only test failures, it seems that only the `update_main_cache_tree(0)` invocation
is needed to avoid a torrent of test failures (490 failures across 102 tests).  Removing lines
946, 947, 949, and 950 do not cause test breakages (although my computer is not set up to
run all of the tests).

However, there seems to be an interaction between lines 946-947 and `update_main_cache_tree(0)`
on line 948: although lines 946-947 can be removed by themselves without test breakages,
when 946-948 are all disabled together (and, in turn, lines 949-950 never run), one additional test
failure is registered (t2203.5).

Thanks,
 - Andrew Keller

--
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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]