Re: Please default to 'commit -a' when no changes were added
- From
- Goswin von Brederlow <goswin-v-b@web.de>
- Date
- Apr 23, 2010, 09:25 UTC
- Message-ID
- <87eii6tt9o.fsf@frosties.localdomain>
- In-Reply-To
- <x2l2cfc40321004221538qade3dd4dkc149f2748b94ef81@mail.gmail.com>
Jon Seymour <jon.seymour@gmail.com> writes:
Show 14 quoted lines
> On Fri, Apr 23, 2010 at 7:48 AM, Adam Brewster <adambrewster@gmail.com> 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