Re: About detached heads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> On Fri, 14 Mar 2008, Bjorn Steinbrink wrote:
>> On 2008.03.14 10:53:25 -0700, Linus Torvalds wrote:
>>> 
>>> So the "core git" way to do it is to literally just do
>>> 
>>> 	git read-tree -u -m 3
>>> 	git commit
>>> 
>>> (or use "--reset" instead of "-m" if you want to do it even in the 
>>> presense unmerged entries).
>>> 
>> 
>> Hm, that's just squashing revert commit. Squashing can be done via:
>> git reset --soft HEAD~5    # Or wherever your squashed commit should start
>> git commit -m "Squashed from HEAD~5 onwards"
>> 
>> Now the "revert" version of that:
>> git reset --hard HEAD~5      # Go back to the state that we want
>> git reset --soft ORIG_HEAD   # Move HEAD back, but keep the index as is
>> git commit -m "Back at the state of HEAD~5"
>> 
>> AFAICT that should have the same advantages as using read-tree, but
>> doesn't feel so low-level :-)
> 
> Umm. The low-level one is a *lot* easier to understand than your 
> "high-level" one, wouldn't you say?
> 
> And when the low-level plumbing commands are easier, are they not then 
> better porcelain?

AFAIK the porcelain equivalent to plumbing

  git read-tree -u -m 3

is just

  git checkout 3 -- .

-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux