git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] checkout: --to requires directory

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 24, 2015, 00:34 UTC
Message-ID
<CACsJy8Bn_cOGzNfPvaqwPztH3==+EVvN8eciYApMc36epbEz1g@mail.gmail.com>
In-Reply-To
<768eecca8711467b43fcc45403ce9ce91bb1550e.1424700971.git.git@drmicha.warpmail.net>

On Mon, Feb 23, 2015 at 9:16 PM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 17 quoted lines
> --to requires a directory, not a file. Say so in the usage string.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
>  builtin/checkout.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 8b2bf20..8cdcd07 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -1341,7 +1341,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
>                          N_("do not limit pathspecs to sparse entries only")),
>                 OPT_HIDDEN_BOOL(0, "guess", &dwim_new_local_branch,
>                                 N_("second guess 'git checkout no-such-branch'")),
> -               OPT_FILENAME(0, "to", &opts.new_worktree,
> +               OPT_STRING(0, "to", &opts.new_worktree, N_("dir"),

Nack. OPT_FILENAME has hidden magic, see fix_filename(). If you want to change the text, you'll have to fall back to using OPTION_FILENAME directly.

>                            N_("check a branch out in a separate working directory")),
>                 OPT_BOOL(0, "ignore-other-worktrees", &opts.ignore_other_worktrees,
>                          N_("do not check if another worktree is holding the given ref")),
-- 
Duy
Previous: Michael J Gruber
Message 18 of 18 in “checkout: --to requires directory”
  1. checkout: --to requires directoryMichael J Gruber, Feb 23, 2015
  2. Jeff KingFeb 23, 2015
  3. Michael J GruberFeb 23, 2015
  4. 0/4 OPT_{FILENAME,PATH}Michael J Gruber, Feb 23, 2015
  5. 1/4 parse-options: introduce OPT_PATHMichael J Gruber, Feb 23, 2015
  6. Junio C HamanoFeb 23, 2015
  7. Michael J GruberFeb 24, 2015
  8. Philip OakleyFeb 23, 2015
  9. 2/4 option-strings: use OPT_FILENAMEMichael J Gruber, Feb 23, 2015
  10. Jeff KingFeb 23, 2015
  11. Junio C HamanoFeb 23, 2015
  12. Junio C HamanoFeb 23, 2015
  13. 3/4 option-strings: use OPT_PATHMichael J Gruber, Feb 23, 2015
  14. Jeff KingFeb 23, 2015
  15. Junio C HamanoFeb 23, 2015
  16. Jeff KingFeb 23, 2015
  17. 4/4 checkout: --to requires directoryMichael J Gruber, Feb 23, 2015
  18. Duy NguyenFeb 24, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.