Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Please default to 'commit -a' when no changes were added

From: Goswin von Brederlow <hidden>
Date: 2016-06-15 22:48:41

Jon Seymour [off-list ref] writes:
On Fri, Apr 23, 2010 at 7:48 AM, Adam Brewster [off-list ref] wrote:
quoted
Consider

$ echo -e '#!/bin/bash\nif git diff-tree --quiet HEAD; then git commit
-a; else git commit; fi' > `git --exec-path`/git-ci
$ chmod 555 `git --exec-path`/git-ci

Adam
Perhaps I am missing something, but I would have thought git
diff-files --quiet would be more useful in this context...

jon.
% git diff-files; git diff-files --quiet; echo $?
:100644 100644 09f06ca1503da57f89331ddc44f0a3c60313c531 0000000000000000000000000000000000000000 M      debian/changelog
:100644 100644 978b107709d1e45b5240a86960587d2a61d8afe6 0000000000000000000000000000000000000000 M      debian/control
1

% git add debian/control

% git diff-files; git diff-files --quiet; echo $?
:100644 100644 09f06ca1503da57f89331ddc44f0a3c60313c531 0000000000000000000000000000000000000000 M      debian/changelog
1

% git add debian/changelog 

% git diff-files; echo $? 
0

Doesn't tell me if there is an index prepared alraedy or not. Only tells
me if there are changes that are not in the index.

MfG
        Goswin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help