SZEDER Gábor <szeder@xxxxxxxxxx> writes: > 'git stash save' saves local modifications to a new stash, and runs 'git > reset --hard' to revert them to a clean index and work tree. When the > '--keep-index' option is specified, after that 'git reset --hard' the > previous contents of the index is restored and the work tree is updated > to match the index. This option is useful if the user wants to commit > only parts of his local modifications, but wants to test those parts > before committing. Please do not describe how it does, before what it does and what it is good for. Here is an example: When preparing for a partial commit (iow, committing only part of the changes you made in your work tree), you would use various forms of "git add" to prepare the index to a shape you think is appropriate for committing, and finally run "git commit". This workflow however has a flaw in that you are committing something that you could never have tested as a whole (and without any other modification) in your work tree. With the new "--keep-index" option, "git stash" takes a snapshot of your index and the work tree state, and updates the work tree to match your index, i.e. what you are about to commit. This way, you can commit with confidence, knowing that you are committing what you saw (and hopefully tested) as a whole in your work tree. After making that initial commit, "git stash pop" will bring the work tree state back without touching the index, so you can start the next cycle of "git add" to prepare the second batch. I do not know if your --keep-index implementation would actually allow the above workflow; I haven't read the patch. -- 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