git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Linus Torvalds <torvalds@osdl.org>, Carl Baldwin <cnb@fc.hp.com>,
	git@vger.kernel.org
Subject: Re: [RFC] undo and redo
Date: Wed, 24 Aug 2005 15:48:21 -0700	[thread overview]
Message-ID: <7vd5o3ar4a.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0508241651420.23242@iabervon.org> (Daniel Barkalow's message of "Wed, 24 Aug 2005 17:04:51 -0400 (EDT)")

Daniel Barkalow <barkalow@iabervon.org> writes:

> Generally, each subdirectory of refs/ has refs to objects of the same
> type, and heads/ is commits, but other directories are other things. tags/
> is all tag objects, and you could have undo/ be trees.

That's OK from the prune front, but I am not sure what the
ramifications of this for pulling, pushing, and resolving.
I would not recommend it without really thinking it through.

Also note that tags/ is not all tag objects.  I think "git tag"
by default creates a lightweight tag, not an annotated kind.

I think you could do either one of two things.  As usual, totally
untested.  Just thinking aloud.

(1) A hack.

     - Have a single "undo-redo" branch, which was forked from
       somewhere on the "master" branch.

     - When doing "undo", make a commit that has the current top
       of undo-redo branch as the first parent and the current
       HEAD commit as the second parent, using the tree that
       represents your snapshot, to grow "undo-redo" branch.

       No, this commit does *not* represent a merge, but I am
       abusing the capability to record more than one parent
       commits.

     - When running "redo", you would want a handy way to name
       what to redo.  You can say "undo-redo~N" to mean "Nth
       from the top of undo-redo branch.

       Your implementation of "redo" can either be (patch way):

       git-diff-tree -p undo-redo~N^ undo-redo~N | git apply --index

       or (merge way):

       git-read-tree -m undo-redo~N^2 undo-redo~N HEAD &&
       git-merge-cache -o git-merge-one-file-script -a

(2) Try StGIT.

  reply	other threads:[~2005-08-24 22:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24 17:23 [RFC] undo and redo Carl Baldwin
2005-08-24 18:10 ` Carl Baldwin
2005-08-24 18:51   ` Linus Torvalds
2005-08-24 19:56     ` Carl Baldwin
2005-08-24 20:44       ` Daniel Barkalow
2005-08-24 20:47         ` Carl Baldwin
2005-08-24 21:04           ` Daniel Barkalow
2005-08-24 22:48             ` Junio C Hamano [this message]
2005-08-25  2:41               ` Carl Baldwin
2005-08-25  5:06                 ` Junio C Hamano
2005-08-25 16:32                   ` Carl Baldwin
2005-08-25 17:39                     ` Kalle Valo
2005-08-25 19:59                     ` Kirby C. Bohling
2005-08-25 20:19                       ` Junio C Hamano
2005-08-25 20:49                         ` Kirby C. Bohling
2005-08-25 21:28                           ` Carl Baldwin
2005-08-25 20:37                       ` Carl Baldwin
2005-08-25 21:09                         ` Kirby C. Bohling
2005-08-25 21:42                           ` Carl Baldwin
2005-08-24 18:18 ` Junio C Hamano
2005-08-24 20:01   ` Carl Baldwin

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=7vd5o3ar4a.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=barkalow@iabervon.org \
    --cc=cnb@fc.hp.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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).