git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* is there a reason pre-commit.sample uses "git diff-index"?
@ 2018-05-31 16:38 Robert P. J. Day
  2018-05-31 17:05 ` Duy Nguyen
  0 siblings, 1 reply; 8+ messages in thread
From: Robert P. J. Day @ 2018-05-31 16:38 UTC (permalink / raw)
  To: Git Mailing list


  was going over some hooks and writing some tutorials for some of the
commit-related, client-side hooks, and was wondering (perhaps
stupidly) why the pre-commit.sample hook uses, as its last line:

  exec git diff-index --check --cached $against --
           ^^^^^^^^^^

as in, could this not be done equivalently with just git diff, not git
diff-index? i just did a quick test and it seems to do the same thing,
but i've never taken a close look at git diff-index before so i may
just be clueless about some important distinction.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-01  2:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 16:38 is there a reason pre-commit.sample uses "git diff-index"? Robert P. J. Day
2018-05-31 17:05 ` Duy Nguyen
2018-05-31 17:27   ` Robert P. J. Day
2018-05-31 17:41     ` Duy Nguyen
2018-05-31 23:08     ` Johannes Sixt
2018-05-31 23:09       ` Robert P. J. Day
2018-05-31 23:25         ` Stefan Beller
2018-06-01  2:23           ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).