All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bj?rn Steinbrink <B.Steinbrink@gmx.de>,
	Geoff Russell <geoffrey.russell@gmail.com>,
	git@vger.kernel.org
Subject: Re: About detached heads
Date: Fri, 14 Mar 2008 12:11:33 -0700 (PDT)	[thread overview]
Message-ID: <m34pb9xgrp.fsf@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.1.00.0803141150070.3557@woody.linux-foundation.org>

Linus Torvalds <torvalds@linux-foundation.org> 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

  reply	other threads:[~2008-03-14 19:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14  9:46 About detached heads Geoff Russell
2008-03-14  9:51 ` Jonathan del Strother
2008-03-14 10:39   ` David Kågedal
2008-03-14 10:15 ` Wincent Colaiuta
2008-03-14 10:48   ` Matthieu Moy
2008-03-14 11:17     ` Wincent Colaiuta
2008-03-14 10:52 ` Jakub Narebski
2008-03-14 12:16   ` Sergei Organov
2008-03-14 12:28   ` Adam Piatyszek
2008-03-14 13:42   ` Chris Shoemaker
2008-03-14 14:53     ` Rafael Garcia-Suarez
2008-03-14 15:19       ` Nicolas Pitre
2008-03-14 15:21       ` Jakub Narebski
2008-03-14 17:53 ` Linus Torvalds
2008-03-14 18:37   ` Björn Steinbrink
2008-03-14 18:51     ` Linus Torvalds
2008-03-14 19:11       ` Jakub Narebski [this message]
2008-03-14 19:17         ` Sean
2008-03-14 23:43           ` Geoff Russell
2008-03-15  0:03             ` Jakub Narebski
2008-03-15  0:38             ` Nicolas Pitre
2008-03-15  2:03               ` Geoff Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34pb9xgrp.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=B.Steinbrink@gmx.de \
    --cc=geoffrey.russell@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.