git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Michael J Gruber <git@drmicha.warpmail.net>
Subject: Re: [PATCH 5/5] grep: convert to use the new get_pathspec()
Date: Sun, 10 Apr 2011 14:26:31 +0700	[thread overview]
Message-ID: <BANLkTim1u2gpcjwyg-kDp=oxC_3SzApNWg@mail.gmail.com> (raw)
In-Reply-To: <7v7hb2zzxp.fsf@alter.siamese.dyndns.org>

2011/4/10 Junio C Hamano <gitster@pobox.com>:
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> This assumes that the new API function will default to "if run without
> pathspec, the calling command wants to limit to cwd", doesn't it?

Yes, I was blindly reimplementing get_pathspec() behavior...

> That is why I mentioned that the caller would need to pass a hint as to
> what should happen in that case in my earlier message.  Probably the new
> API function should be something like:
>
>    setup_pathspec(&pathspec, prefix, argc, argv, opts)
>
> where opts is a bitmask to carry that hint (or a pointer to a structure
> that caller to carry a set of hints richer than a bitmask can express),
> and "add -u" and "grep" should set PATHSPEC_DEFAULT_LOCAL in the bitmask.
> The call to setup_pathspec() from the log family would not want "no user
> specified pathspec means limited to local" semantics.
>
> Then when somebody wants to flip the "add -u" default in future versions,
> the call from "add -u" codepath can instead use PATHSPEC_DEFAULT_TREEWIDE
> (or perhaps the lack of PATHSPEC_DEFAULT_LOCAL bit may mean tree-wide)
> there.

... and forgot about this.
-- 
Duy

  reply	other threads:[~2011-04-10  7:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-09 16:54 [PATCH 0/5] New get_pathspec() Nguyễn Thái Ngọc Duy
2011-04-09 16:54 ` [PATCH 1/5] Rename functions in preparation for get_pathspec() restructure Nguyễn Thái Ngọc Duy
2011-04-09 16:54 ` [PATCH 2/5] Replace has_wildcard with PATHSPEC_NOGLOB Nguyễn Thái Ngọc Duy
2011-04-10  0:49   ` Junio C Hamano
2011-04-10  7:23     ` Nguyen Thai Ngoc Duy
2011-04-09 16:54 ` [PATCH 3/5] Convert prefix_pathspec() to produce struct pathspec_item Nguyễn Thái Ngọc Duy
2011-04-09 16:54 ` [PATCH 4/5] Implement new get_pathspec() Nguyễn Thái Ngọc Duy
2011-04-09 16:54 ` [PATCH 5/5] grep: convert to use the " Nguyễn Thái Ngọc Duy
2011-04-10  0:56   ` Junio C Hamano
2011-04-10  7:26     ` Nguyen Thai Ngoc Duy [this message]
2011-04-09 21:41 ` [PATCH 0/5] New get_pathspec() 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

  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='BANLkTim1u2gpcjwyg-kDp=oxC_3SzApNWg@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@drmicha.warpmail.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.
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).