git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Geoff Russell" <geoffrey.russell@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: About detached heads
Date: Fri, 14 Mar 2008 17:03:10 -0700 (PDT)	[thread overview]
Message-ID: <m3zlt0x39k.fsf@localhost.localdomain> (raw)
In-Reply-To: <93c3eada0803141643r2f2c4c56l9e59f2ee7b67a8ca@mail.gmail.com>

"Geoff Russell" <geoffrey.russell@gmail.com> writes:

> I thought my question was trivial, but judging by the number of
> answers, clearly not!
> 
> I understand "git read-tree -u -m 3 ; git commit" and it does exactly
> what I want.
> 
> The context where I want to use this is for users who update files,
> can understand "take me back to the state I was in at 4pm yesterday
> before I mucked up my data" but who don't want to know about
> merging, branching, topics, etc, etc, But of course having taken
> them back to the 4pm commit, they then realise that they really need
> the 6pm commit or perhaps the 3pm commit. So anything which just
> throws away commits would be risky.

Thanks to the reflog even if they go the "git reset --hard 3" route,
the commits would be protected for gc.reflogExpireUnreachable period,
which defaults to 30 days, by reflog. After this period they could be
garbage-collected.

> The "git read-tree -u -m 3; git commit" allows me to present a
> simple straight line view of the data, which is perfect for the
> people I'm dealing with.

Simple, straight line with _rewinds_, i.e. not so simple history.

Unless you can expect users to find errors later than 30 days, or you
have pushed non-rewritable branch already, then "git reset --hard 3"
is IMHO a beter solution than "git read-file -u -m 3 && git commit -a".

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2008-03-15  0:03 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
2008-03-14 19:17         ` Sean
2008-03-14 23:43           ` Geoff Russell
2008-03-15  0:03             ` Jakub Narebski [this message]
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=m3zlt0x39k.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=geoffrey.russell@gmail.com \
    --cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).