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

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

 



Am 31.05.2018 um 19:27 schrieb Robert P. J. Day:
On Thu, 31 May 2018, Duy Nguyen wrote:
git diff-index is "plumbing", designed for writing scripts. "git
diff" on the other hand is for users and its behavior may change
even if it breaks backward compatibility.

   ah, this was a philosophical underpinning i was unaware of. i see
occasional explanations of git porcelain versus plumbing, but i don't
recall anyone simply stating that the plumbing is meant to have a
long-term stability that is not guaranteed for the porcelain.

So, there you have it. ;) Plumbing commands offer long-term stability. That is not just philosophical, but practically relevant.

   in any event, this does mean that, stability issues aside, "git
diff" would apparently have worked just fine for that hook.

It may have worked just fine. You should still not use it.

Didn't you say that you are teaching git and hooks? Then you should teach the right thing, and the right thing is to use plumbing for scripts.

-- Hannes



[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