git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 0/4] Re-fix get_pathspec()
Date: Fri,  7 Mar 2008 00:38:35 -0800	[thread overview]
Message-ID: <1204879119-7528-1-git-send-email-gitster@pobox.com> (raw)

After 1.5.4, we improved get_pathspec() to allow absolute paths, because
people wanted to cut&paste from file managers and such, so that you can
feed absolute paths to "git add" and friends.

However, the paths still must be inside work tree, so there must be a way
to ensure that.  d089eba (setup: sanitize absolute and funny paths in
get_pathspec()) botched the interface, by making the check the
responsibility of the callers, while keeping the interface to the function
intact, which meant that the callers needed to count returned pathspecs
and compared it with the number of paths fed to the function.

This miniseries cleans up the interface by making get_pathspec() to die
again.

Junio C Hamano (4):
  get_pathspec(): die when an out-of-tree path is given
  Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files)
  Revert part of 1abf095 (git-add: adjust to the get_pathspec() changes)
  Revert part of d089eba (setup: sanitize absolute and funny paths in
    get_pathspec())

 builtin-add.c              |   12 ------------
 builtin-ls-files.c         |   11 +----------
 builtin-mv.c               |    6 +-----
 setup.c                    |    2 ++
 t/t3101-ls-tree-dirname.sh |    2 +-
 t/t7010-setup.sh           |    7 ++++---
 6 files changed, 9 insertions(+), 31 deletions(-)


             reply	other threads:[~2008-03-07  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07  8:38 Junio C Hamano [this message]
2008-03-07  8:38 ` [PATCH 1/4] get_pathspec(): die when an out-of-tree path is given Junio C Hamano
2008-03-07 18:29   ` Robin Rosenberg
2008-03-07 18:51     ` Junio C Hamano
2008-03-07 11:53 ` [PATCH 0/4] Re-fix get_pathspec() Johannes Schindelin
2008-03-07 17:48   ` Junio C Hamano
2008-03-08  9:37 ` 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=1204879119-7528-1-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.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.
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).