On 07/11/2013 09:22 AM, Eric Blake wrote:
On 07/11/2013 07:12 AM, Eric Blake wrote:
> Yes, it can be reasonable to push a patch while the tree is still dirty
> for unrelated reasons. But I agree that it seems like an advanced
> option, and that most users would much rather be informed any time
> 'send-email' or 'push' is attempted while changes are still pending,
> especially if the changes being emailed or pushed touch the same files.
> There's probably a way to set up git hooks to forbid push actions if
> the tree is dirty, but that would be a question for the git lists or irc
> channel.
>
> If either one of us finds a solution for such a hook, be sure to post it
> back here.
The git IRC channel suggested setting your shell prompt to call the
various bash functions made available by git, so that you at least have
a designation in your prompt of what branch you are on and whether it is
clean or dirty. Of course, that assumes you look at your prompt before
sending/pushing,
Yeah, I already do that, but it's not colorized, which is a good idea. I
tend to miss visual clues when I'm in a hurry though, so definitely a
solution that actually *prevents* the dangerous operation would be better.