All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Octavio Alvarez" <alvarezp@alvarezp.ods.org>
To: "Junio C Hamano" <gitster@pobox.com>,
	"David Kågedal" <davidk@lysator.liu.se>
Cc: "Felipe Contreras" <felipe.contreras@gmail.com>,
	"markus heidelberg" <markus.heidelberg@web.de>,
	"Sverre Rabbelier" <srabbelier@gmail.com>,
	"David Aguilar" <davvid@gmail.com>,
	git@vger.kernel.org
Subject: Re: [RFC/PATCH 0/2] New 'stage' command
Date: Tue, 07 Apr 2009 01:39:04 -0700	[thread overview]
Message-ID: <op.ur0czewh4oyyg1@localhost.localdomain> (raw)
In-Reply-To: <7v8wmd46p9.fsf@gitster.siamese.dyndns.org>

On Mon, 06 Apr 2009 18:02:10 -0700, Junio C Hamano <gitster@pobox.com> wrote:

> David Kågedal <davidk@lysator.liu.se> writes:
>
>>>    - when you want to work with both the index and the work tree at the
>>>      same time, you say STAGEANDWORKTREE (the same disambiguation  
>>> caveat
>>>      applies).
>>
>> No, where did this come from?
>
> "git apply STAGEANDWORKTREE this.patch".  I do not want "for diff you can
> use these metavariables to name two things compared, but you can do so
> only for diff".

That example is broken. git apply doesn't even take an arbitrary treeish.

>>> Think.  What does "git log STAGE" mean?  Can you explain why it does  
>>> not
>>> make any sense?

gitk actually does this. Even more, gitk shows them in this order:
STAGE^ would be HEAD.
WORKTREE^ would be STAGE.

Makes sense.

(Not that I think git log should do the same.)

The difference between git diff and git reset is that git diff should take
a range of trees, not a range of commits as parameters. OTOH, git reset
doesn't know or care about trees, it needs commits.

git checkout WORKTREE:file makes sense, even though it is useless, but
that's why it git checout STAGE:file makes sense: it should accept any tree
instead of a commit.

git apply doesn't even take commits. It *could* take trees if it
automagically created a branch on the commit, though. Either that,
or git-apply shouldn't exist at all.

It's similar with git reset. You wouldn't use STAGE or WORKTREE here because
a commit is actually necessary, but according option names like: --stage
--worktree --both --none are better than --hard, --soft and --mixed.

So, if the man page for git-reset says "commit-id" and the man page for
git diff says "tree-id..tree-id", I don't see any kind of confusion.
git checkout could too. git reset and git log are to say "commit-id",
but support clearer options.

WORKTREE, STAGE are trees as commits are also trees, but not all trees are
commits.

  reply	other threads:[~2009-04-07  8:41 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-05 13:48 [RFC/PATCH 0/2] New 'stage' command Felipe Contreras
2009-04-05 13:48 ` [RFC/PATCH 1/2] git: remote stage Felipe Contreras
2009-04-05 13:48   ` [RFC/PATCH 2/2] Add new 'git stage' script Felipe Contreras
2009-04-05 19:02 ` [RFC/PATCH 0/2] New 'stage' command Junio C Hamano
2009-04-05 19:28   ` Felipe Contreras
2009-04-05 19:33     ` Junio C Hamano
2009-04-05 19:59       ` Junio C Hamano
2009-04-05 20:41         ` Felipe Contreras
2009-04-05 20:55           ` Jay Soffian
2009-04-05 22:06             ` Felipe Contreras
2009-04-05 19:34     ` [RFC/PATCH 0/2] " Nicolas Sebrecht
2009-04-05 21:58 ` [RFC/PATCH 0/2] " Markus Heidelberg
2009-04-05 22:35   ` Felipe Contreras
2009-04-05 23:06     ` Björn Steinbrink
2009-04-05 23:23       ` Markus Heidelberg
2009-04-06  9:48         ` Björn Steinbrink
2009-04-05 23:17     ` Markus Heidelberg
2009-04-05 23:22       ` Sverre Rabbelier
2009-04-05 23:45         ` Johannes Schindelin
2009-04-06  9:37           ` Felipe Contreras
2009-04-06  3:24         ` David Aguilar
2009-04-06  5:17           ` Junio C Hamano
2009-04-06  5:53             ` David Aguilar
2009-04-06  6:18               ` Junio C Hamano
2009-04-06 13:20             ` David Kågedal
2009-04-06 13:42               ` David Kågedal
2009-04-06 18:30               ` Junio C Hamano
2009-04-06 19:13                 ` Felipe Contreras
2009-04-06 19:25                   ` Björn Steinbrink
2009-04-07 10:01                     ` Felipe Contreras
2009-04-07 12:45                       ` Johannes Schindelin
2009-04-06 20:49                 ` Matthieu Moy
2009-04-07  0:55                   ` Junio C Hamano
     [not found]                 ` <87skkligzb.fsf@krank.kagedal.org>
2009-04-07  1:02                   ` Junio C Hamano
2009-04-07  8:39                     ` Octavio Alvarez [this message]
     [not found]                       ` <878wmcj1fs.fsf@krank.kagedal.org>
2009-04-07 15:01                         ` Octavio Alvarez
2009-04-07  1:36                 ` Stefan Karpinski
2009-04-07  7:38                 ` Octavio Alvarez

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=op.ur0czewh4oyyg1@localhost.localdomain \
    --to=alvarezp@alvarezp.ods.org \
    --cc=davidk@lysator.liu.se \
    --cc=davvid@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=markus.heidelberg@web.de \
    --cc=srabbelier@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 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.