Re: git-diff on touched files: bug or feature?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 3, 2007, 08:57 UTC
- Message-ID
- <7vir7xngfs.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20070803082435.GA15475@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Without making a partial commit, how would you split the > bugfix changes from the working changes? Or do you manually > pull the bugfix into another branch or working tree?
I typically stash the WIP away with "git diff HEAD >P.diff && git reset --hard" (I should learn to use "git stash" these days), and switch to an appropriate branch for bugfix (if it is generally applicable) or stay on the branch (if it is a fix-up for an earlier patch for the topic) to work on the fix. Then unstash to continue where I left off.
> In your workflow, how do you > remind yourself that there are untracked files that need to be added? Do > you just wait until you see the commit template at the end?
I do not leave files that need to be added untracked for a long time. Also, I tend to be picky about making sure that (1) things build from scratch, and that (2) "make clean" removes all crufts. Because of this, I run "make clean" followed by "git clean -n" more often than other people. The latter picks them up if I forget to add them when I created them.