is there a reason pre-commit.sample uses "git diff-index"?

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

 



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



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

  Powered by Linux