Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-07 Thread Dimitar Bonev
Junio C Hamano wrote: > Dimitar Bonev writes: > > [administrivia: please do not drop people out of Cc list] > > That invites another question: if it is very well related, why isn't > it an option to start from the state you have in the working tree > (i.e. doing nothing), or in the index (i.e. "g

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-06 Thread Junio C Hamano
Dimitar Bonev writes: [administrivia: please do not drop people out of Cc list] > Actually this is not the case as I tried to explain with the 'git > commit' followed by 'git checkout HEAD~1 -- targetfile' followed by > 'git commit --amend' example. The index and the working dir states are > ver

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-06 Thread Thomas Rast
Dimitar Bonev writes: > One more argument against the suggestion of doing a commit ahead of > time is that I like to think in separation to reduce complexity - in > particular I like to think only for the working dir and index states, > commits - I treat them as finished work. If I have to amend

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-04 Thread Dimitar Bonev
On Sat, May 4, 2013 at 9:48 PM, Jonathan Nieder wrote: > Is there no way to convince PowerShell to treat the output of a > command as binary data with no particular encoding? The best I could find out is to pipe the output to set-content: git show HEAD:targetfile | set-content targetfile The de

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-04 Thread Junio C Hamano
Junio C Hamano writes: > "I have something worth saving, better than HEAD in some way > (e.g. contains fixes), in my index. I want to keep it while I > experiment an approach that is unrelated to it, so I want a clean > slate in the working tree from HEAD without disturbing the index". > > At the

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-04 Thread Junio C Hamano
Thomas Rast writes: >> I have been looking for such a command/option and no one gave me >> sufficient answer. So this message should be considered as a feature >> request. I had a situation where I had staged a file with a problem >> solution in it, then I wanted to experiment with a different so

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-04 Thread Jonathan Nieder
Dimitar Bonev wrote: > @ThomasRast: 'git show HEAD:targetfile > targetfile' was proposed in > the both links that I provided in the email that your replied to, but > this introduces external dependency to the command interpreter to > output the file unmodified but not every interpreter does this.

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-04 Thread Dimitar Bonev
I think if there was such a command, it could well be common, at least for me. I am somewhat surprised that from the three combinations of resetting index and working dir's states of a file this is the one that is missing (it is missing at commit level also for what is worth). Summary table of res

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

2013-05-04 Thread Thomas Rast
Dimitar Bonev writes: > I have been looking for such a command/option and no one gave me > sufficient answer. So this message should be considered as a feature > request. I had a situation where I had staged a file with a problem > solution in it, then I wanted to experiment with a different solu