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

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

 



Jon Seymour <jon.seymour@xxxxxxxxx> writes:

> On Fri, Apr 23, 2010 at 7:48 AM, Adam Brewster <adambrewster@xxxxxxxxx> wrote:
>
>> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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