From: Junio C Hamano <gitster@pobox.com>
To: Andrew Keller <andrew.keller@covenanteyes.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: obsolete index in wt_status_print after pre-commit hook runs
Date: Fri, 15 Jul 2016 10:02:20 -0700 [thread overview]
Message-ID: <xmqq1t2uomw3.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <5988D847-25A2-4997-9601-083772689879@covenanteyes.com> (Andrew Keller's message of "Fri, 15 Jul 2016 16:34:19 +0000")
Andrew Keller <andrew.keller@covenanteyes.com> writes:
> I have observed an interesting scenario. Here are example reproduction steps:
>
> 1. new repository
> 2. create new pre-commit hook that invokes `git mv one two`
> 3. touch one
> 4. git add one
> 5. git commit
>
> Expected outcome: In the commit message template, I expect to see
> “Changes to be committed: new file: two"
Expected outcome is an error saying "do not modify the index inside
pre-commit hook", and a rejection. It was meant as a verification
mechansim (hence it can be bypassed with --no-verify), not as a way
to make changes that the user didn't tell "git commit" to make.
It is just the implementation that dates back to the old days were
too trusting that all users would behave (with its own definition of
"behaving well", which may or may not match your expectation), did
not anticipate that people would try to muck with the contents being
commited in the hook, and did not implement such verification.
next prev parent reply other threads:[~2016-07-15 17:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 16:34 obsolete index in wt_status_print after pre-commit hook runs Andrew Keller
2016-07-15 17:02 ` Junio C Hamano [this message]
2016-07-15 17:20 ` Andrew Keller
2016-07-15 17:28 ` Junio C Hamano
2016-07-15 17:42 ` Andrew Keller
2016-07-15 20:30 ` Andrew Keller
2016-07-15 21:19 ` Junio C Hamano
2016-07-15 22:03 ` Junio C Hamano
2016-07-16 2:39 ` Andrew Keller
2016-08-03 18:25 ` Andrew Keller
2016-08-04 16:45 ` Junio C Hamano
2016-08-05 13:22 ` Andrew Keller
2016-07-16 2:23 ` Andrew Keller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1t2uomw3.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=andrew.keller@covenanteyes.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.