git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Carl Baldwin <cnb@fc.hp.com>
Cc: Tommi Virtanen <tv@inoi.fi>, Shawn Pearce <spearce@spearce.org>,
	git@vger.kernel.org
Subject: Re: The git newbie experience
Date: Mon, 15 May 2006 13:47:22 -0700	[thread overview]
Message-ID: <7vhd3rhv6t.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 20060515164610.GA24295@hpsvcnb.fc.hp.com

Carl Baldwin <cnb@fc.hp.com> writes:

> My implementation actually wrote the working file state into the object
> store as a tree and stored a reference to the tree under something like
> .git/refs/undo (or .git/refs/stash).  Redo was a simple merge of this
> tree back onto the current working files.
>
> I think I would like something like this better than the 'generate
> binary patch and reapply the patch later.

When you think of the "binary patch" as a human readable
representation of your (hierarchical set of) tree objects, you
would realize that these two approaches aren't that much
different at the tree merge level, and it's just a matter of
which representation is more convenient and human readable.

Pros and cons I see are:

 * Branch approach needs to teach users only one thing -- create
   a branch, merge with it, throw it away.  Which is something
   the user needs to know anyway, so it is a plus.

 * Branch approach needs to store a full postimage tree and the
   base commit (so you can use it as a merge base); the
   postimage tree includes paths that are not involved in the
   change being stashed.

 * Patch records only the object names of paths that are relevant
   to the stash.  Instead of keeping the full postimage tree, it
   creates one on the fly when you actually do the unstashing.

 * Patch is human readable and can be used for purposes other
   than falling back to a three-way merge.  When cleanly applies
   apply + write-tree is faster than a tree merge.

 * Patch could be verbose if the change being stashed is large;
   after all the primary information used are the object names
   recorded on the "index" lines and the patch text itself is a
   waste from storage point of view.  This is a disadvantage of
   the "patch" approach, but its readability might offset it.
   If a change being stashed is large, the user had better be
   doing it on a separate topic branch anyway, so this might not
   be a big issue.

  reply	other threads:[~2006-05-15 20:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-14 18:36 The git newbie experience Tommi Virtanen
2006-05-14 21:26 ` Junio C Hamano
2006-05-14 22:09 ` Junio C Hamano
2006-05-15  5:06   ` Tommi Virtanen
2006-05-15  5:18     ` Junio C Hamano
2006-05-15  5:31       ` Shawn Pearce
2006-05-15  8:39         ` Junio C Hamano
2006-05-15 16:46           ` Carl Baldwin
2006-05-15 20:47             ` Junio C Hamano [this message]
2006-05-15 20:42           ` Carl Worth
2006-05-15 21:10             ` Junio C Hamano
2006-05-15  5:27     ` Shawn Pearce

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vhd3rhv6t.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=cnb@fc.hp.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    --cc=tv@inoi.fi \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).