All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] read-tree: at least one tree-ish argument is required
Date: Fri, 18 Dec 2009 20:04:25 +0100	[thread overview]
Message-ID: <200912182004.25520.j.sixt@viscovery.net> (raw)
In-Reply-To: <7v4onoywws.fsf@alter.siamese.dyndns.org>

On Freitag, 18. Dezember 2009, Junio C Hamano wrote:
> Johannes Sixt <j.sixt@viscovery.net> writes:
> > You have queued 1/2 (filter-branch: remove an unnecessary use of
> > 'git read-tree') of this 2-patch series, but I haven't seen any comments
> > about this 2/2 nor is it queued. Did it fall through the cracks?
>
> No.  I think saying "is not allowed" is going a bit too far [*1*].

Yes, you said that, but in response to the footnote in 1/2.

> The 
> documentation does not list it as a commonly useful thing, that's all.

IMO, not only is it not useful, but it is also dangerous - it erases the 
index!

> When a user wants to have an empty index, and does not want to touch files
> under $GIT_DIR with any non-git tools (e.g. "rm -f $GIT_DIR/index) for
> some religious reasons, "read-tree" without a tree would be one valid way
> to do so [*2*].
> *2* I suspect "rm --cached ." might be another, but it would probably be
> much more expensive.

For an operation like this, shouldn't we advocate this alternate instruction 
(which explicitly tells what is wanted) rather than the implicit and 
undocumented operation of parameter-less read-tree?

> We need to make arguments like "'read-tree' given by mistake to empty the
> index is risky", "'read-tree' as 'rm -f $GIT_DIR/index' replacement has
> little value", and "'read-tree' as 'rm -f $GIT_DIR/index' replacement is
> the best way to get an empty index" to weigh pros and cons between two
> possible approaches before deciding which way to go, but in a pre-release
> freeze, I wasn't in the mood to be one who is doing the arguments myself.

Sorry to drag you into this discussion, but I felt this change is maint-worthy 
(because the behavior is not only risky, but dangerous).

-- Hannes

  reply	other threads:[~2009-12-18 19:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15  8:42 [PATCH 1/2] filter-branch: remove an unnecessary use of 'git read-tree' Johannes Sixt
2009-12-15  8:43 ` [PATCH 2/2] read-tree: at least one tree-ish argument is required Johannes Sixt
2009-12-18  9:51   ` Johannes Sixt
2009-12-18 18:11     ` Junio C Hamano
2009-12-18 19:04       ` Johannes Sixt [this message]
2009-12-18 19:24         ` Sverre Rabbelier
2009-12-18 19:32         ` Junio C Hamano
2009-12-18 19:37           ` Sverre Rabbelier
2009-12-18 19:49             ` Junio C Hamano
2009-12-18 19:59               ` Sverre Rabbelier
2009-12-18 20:13                 ` Junio C Hamano
2009-12-18 20:21                   ` Sverre Rabbelier
2009-12-18 22:04               ` Johannes Sixt
2009-12-18 22:17                 ` Jakub Narebski
2009-12-18 23:46                   ` Junio C Hamano
2009-12-19  3:25                     ` Nanako Shiraishi
2009-12-19  4:43                       ` Junio C Hamano
2009-12-19  4:53                         ` Junio C Hamano
2009-12-19 10:56                           ` Johannes Schindelin
2009-12-15 17:19 ` [PATCH 1/2] filter-branch: remove an unnecessary use of 'git read-tree' Johannes Schindelin
2009-12-16  0:19 ` 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=200912182004.25520.j.sixt@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.