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

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

 



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

Maybe so.  I really just meant to suggest that if you need something
more complicated than a simple git-command, you can put whatever you
want in a shell script and use it like an alias.

Then I learned that git aliases can be pretty fancy if they start with "!sh -c".

After looking at the man pages a bit more, I think "git diff --cached
--quiet" or "git diff-index --cached --quiet HEAD" are the right
condition.  git diff-files will compare the working copy to the index,
so this sequence

  vi file1
  vi file2
  git add file1
  git ci

would call commit -a, and I think that's wrong.

I also now realize that some use needs to be made of the arguments.
As I sent it the first time, "git ci -m whatever" doesn't work as it
should.  Adding "$@" to the git commit call doesn't work either
because it breaks "git ci filename" if there is no index (it calls
"git commit -a filename").
--
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]