From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>,
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Sebastian Pipping <webmaster@hartwork.org>,
Michael J Gruber <git@drmicha.warpmail.net>,
Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
Git ML <git@vger.kernel.org>
Subject: Re: "git add -u" broken in git 1.7.4?
Date: Mon, 7 Feb 2011 19:34:12 +0100 [thread overview]
Message-ID: <20110207183412.GB1900@neumann> (raw)
In-Reply-To: <7vhbcguytf.fsf@alter.siamese.dyndns.org>
On Sun, Feb 06, 2011 at 10:46:20PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > Is "git add -p" broken, then? It takes pathspecs relative to the current
> > directory, but "git add -p" without arguments operates from the root,
> > not from the current subdirectory.
>
> I would say so; "add -p" was an ill-executed afterthought. The codepath
> was originally meant to be used from "-i" as the top-level interface that
> was a fully interactive way to prepare for the next commit, which is an
> operation that is inherently full-tree.
>
> There are two schools of thought in previous threads discussing full-tree
> vs current-directory-relative. I think each side has merits.
>
> If we defaulted to the current directory (i.e. "git grep"), that would
> feel more natural as it is more consistent with how tools that are not git
> aware (e.g. "GNU grep" run in the same directory) behave. A downside is
> when you are somewhere deep in a working tree, you have to know how deep
> you are and repeat "../" that many times, i.e. "git grep pattern ../../"
>
> If we defaulted to the root-level (i.e. "git diff"), you do not have that
> downside (iow, "git diff" run from a deep directory is a full tree
> operation), and you can limit the scope to the current directory by a
> single dot, i.e. "git diff .". A huge downside is that this may feel
> awkward for new people who do not yet breath git [*1*], as no other git
> aware tool would behave like this, limiting its scope to some directory
> that is higher above.
>
> In the past, I have took the third position, saying that tools that
> semantically needs to be full-tree should be full-tree (i.e. ones that
> make or format commits), and others should be relative to the current
> directory (i.e. ones that are used to inspect your progress, such as
> grep), but that is not a very understandable guideline that people can
> easily follow. If we have to choose between the two and make things
> consistent, my personal preference is to make everything relative to the
> current working directory.
_Everything_ relative to the current working directory? I can't
imagine how would that work in practice. Could you explain what would
the following commands do, for example, when they are relative to the
current working directory?
$ cd t
$ git checkout next
$ git merge somebranch
$ git reset HEAD^
Best,
Gábor
next prev parent reply other threads:[~2011-02-07 18:34 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 0:39 "git add -u" broken in git 1.7.4? Sebastian Pipping
2011-02-06 5:13 ` Jeff King
2011-02-06 19:35 ` Sebastian Pipping
2011-02-06 20:48 ` Matthieu Moy
2011-02-06 23:19 ` SZEDER Gábor
2011-02-06 23:49 ` Sebastian Pipping
2011-02-07 5:50 ` Junio C Hamano
2011-02-07 5:53 ` Jeff King
2011-02-07 6:46 ` Junio C Hamano
2011-02-07 7:29 ` Nguyen Thai Ngoc Duy
2011-02-07 18:34 ` SZEDER Gábor [this message]
2011-02-07 19:31 ` Junio C Hamano
2011-02-07 19:50 ` Jeff King
2011-02-08 10:05 ` SZEDER Gábor
2011-02-09 21:03 ` Jeff King
2011-02-09 22:40 ` Junio C Hamano
2011-02-09 23:46 ` Jeff King
2011-02-10 2:24 ` Nguyen Thai Ngoc Duy
2011-02-10 2:31 ` Jeff King
2011-02-10 2:46 ` Junio C Hamano
2011-02-10 7:46 ` Johannes Sixt
2011-02-10 8:13 ` Joshua Juran
2011-02-10 18:00 ` Matthieu Moy
2011-02-15 7:04 ` [PATCH] command-list.txt: mark git-archive plumbing Nguyen Thai Ngoc Duy
2011-02-15 19:11 ` Junio C Hamano
2011-02-16 9:32 ` Nguyen Thai Ngoc Duy
2011-02-07 20:57 ` "git add -u" broken in git 1.7.4? Matthieu Moy
2011-02-07 21:02 ` Jeff King
2011-02-07 21:49 ` Junio C Hamano
2011-02-08 1:25 ` Eric Raible
2011-02-08 2:16 ` Junio C Hamano
2011-02-07 6:48 ` Matthieu Moy
2011-02-07 8:27 ` Michael J Gruber
2011-02-07 11:15 ` SZEDER Gábor
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=20110207183412.GB1900@neumann \
--to=szeder@ira.uka.de \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
--cc=webmaster@hartwork.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.
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).