git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Scott Chacon <schacon@gmail.com>,
	Michael Nahas <mike@nahas.com>
Subject: Re: [RFC/PATCH] git put: an alternative to add/reset/checkout
Date: Tue, 07 Jun 2011 14:04:55 -0700	[thread overview]
Message-ID: <7vvcwh4ako.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110607200659.GA6177@sigill.intra.peff.net> (Jeff King's message of "Tue, 7 Jun 2011 16:06:59 -0400")

Jeff King <peff@peff.net> writes:

> As you can see, this handles only three typoes of locations: the

Is that a recursive typo, or a typo of type?

> worktree, the index, and an arbitrary commit (really a tree-ish).

> Some other types I've thought of are:
>
>   - stashes; you can already use stashes a source with "stash@{0}". They
>     could also be a destination, chaining to "git stash".

No opinion on this.

>   - branches as destinations; obviously we can't change an existing
>     commit, but what about something like:
>
>       git put WORKTREE BRANCH:foo
>
>     to optionally create a new branch "refs/heads/foo" based on the
>     current HEAD, push changes into a temporary index that matches its
>     tip, and then making a new commit based on top.
>
>     This would serve a similar purpose to stashes, except that they
>     would be named and could operate as full branches. I would find it
>     useful for picking apart a mass of worktree changes into discrete
>     commits.

Should "git put WORKTREE HEAD" be equivalent to "git commit -A" then?

>   - allow multiple destinations, like
>
>      # equivalent to "git checkout --"
>      git put HEAD INDEX,WORKTREE

This is close to going overboard, but OK.

>   - blobs as locations. We could allow something like:
>
>       git put v1.7.5:Makefile WORKTREE:Makefile
>
>     which would be equivalent to
>
>       git put v1.7.5 WORKTREE -- Makefile
>
>     but sometimes matches the user's mental model better. It also allows
>     pulling blobs from index stages, like:
>
>       # Resolve in favor of "ours"
>       git put :2:Makefile INDEX,WORKTREE

More importantly, it would allow people to do things like...

	git put v1.7.5:Makefile WORKTREE:oMakefile
        magicdiff oMakefile Makefile

>   - subtrees as locations. This allows a form of renaming between old
>     versions.
>
>       git put gitgui-0.10.0: WORKTREE:git-gui

This is a natural extension of the above "we could rename" theme, right?

> ...  Of course, it may also just introduce insane
> confusion.

The only worry about confusion is if people incorrectly think these magic
tokens are not mere syntax sugars available only in "put", especially,
they look so similar to "HEAD" which is _not_ syntax sugar and can be used
elsewhere. Other than that, I think this is a nice approach.

  reply	other threads:[~2011-06-07 21:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 20:06 [RFC/PATCH] git put: an alternative to add/reset/checkout Jeff King
2011-06-07 21:04 ` Junio C Hamano [this message]
2011-06-07 21:45   ` Jeff King
2011-06-08  3:07     ` Michael Nahas
2011-06-08 17:25     ` Jakub Narebski
2011-06-08 17:28       ` Matthieu Moy
2011-06-08 17:30         ` Jeff King
2011-06-08 17:34           ` Matthieu Moy
2011-06-08 17:50             ` Jakub Narebski
2011-06-08 18:01               ` Matthieu Moy
2011-06-08 18:57                 ` Jakub Narebski
2011-06-10 12:38       ` Nguyen Thai Ngoc Duy
2011-06-08 15:18 ` Nguyen Thai Ngoc Duy
2012-01-23 10:32 ` Nguyen Thai Ngoc Duy
2012-01-23 13:53   ` Michael Nahas
2012-01-23 14:35     ` Nguyen Thai Ngoc Duy
2012-01-23 14:56       ` Michael Nahas
2012-01-23 18:10         ` Junio C Hamano

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=7vvcwh4ako.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mike@nahas.com \
    --cc=peff@peff.net \
    --cc=schacon@gmail.com \
    /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).