Bug#578764: 'commit -a' safety (was: Re: Please default to 'commit -a' when no changes were added)

2010-04-24 Thread Jakub Narebski
Jonathan Nieder  writes:

> Starting out, I can see how it would be comforting to people if
> ‘git commit’ would default to -a behavior if they ignore the index.
> That is logically a different operation, though, so it would also send
> a wrong message and make it harder in the long run to get used to the
> interface.

I agree that making 'git commit' do 'git commit -a' if there are no
staged changes would be a bad change.

> Instead, I think it would be better to focus on making the error
> message more helpful.  Right now there is a screen full of status
> before the advice, which might make it easy to get scared before
> reading it.
>
> Here’s a very rough patch to suppress that screenful.  What do you
> think?

It's a pity that people didn't concentrate on this part: improving
error message...


On a bit unrelated note what I'd like to have is 'git commit -a'
(optional) safety against accidentally getting rid of staged changes.

I'd like for 'git commit -a' to *fail* if there are staged changes for
tracked files, excluding added, removed and renamed files.  If you
have some staged changes you would get an error message:

  $ git add tracked-file
  $ git commit -a
  fatal: There are staged changes to tracked files
  hint: To commit staged changes, use 'git commit'
  hint: To commit all changes, use 'git commit -f -a' 

Perhaps this behavior would be turned on only if some config option,
like commit.preserveIndex or something like that is set to true...
-- 
Jakub Narebski
Poland
ShadeHawk on #git



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#469250: Commit f5bbc322 to git broke pre-commit hooks which read stdin

2008-03-04 Thread Jakub Narebski
Johannes Schindelin <[EMAIL PROTECTED]> writes:
> On Tue, 4 Mar 2008, David Bremner wrote:
> 
>> It looks like line 435 of builtin-commit.c disables stdin for hooks 
>> (with the disclaimer that I first looked at the git source ten minutes 
>> ago).
>> 
>> hook.no_stdin = 1
>> 
>> I'm not sure if this was by design, but just so you know, this breaks 
>> people's hooks.  In particular the default metastore pre-commit hook no 
>> longer works.  I didn't find anything relevant in the docs [1].
> 
> Pardon my ignorance, but what business has metastore reading stdin?  There 
> should be nothing coming in, so the change you mentioned should be 
> correct, and your hook relies on something it should not rely on.

Never mind pre-commit. What about pre-receive and post-receive hooks,
both of which gets data on stdin?

-- 
Jakub Narebski
Poland
ShadeHawk on #git



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]