git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Paul Morelle <paul.morelle@gmail.com>
Cc: "Robin H. Johnson" <robbat2@gentoo.org>,
	Git Mailing List <git@vger.kernel.org>,
	Prathamesh Chavan <pc44800@gmail.com>,
	Stefan Beller <stefanbeller@gmail.com>
Subject: Re: regression AGAIN in output of git-pull --rebase --recurse-submodules=yes --quiet
Date: Tue, 16 Apr 2019 14:48:30 +0700	[thread overview]
Message-ID: <CACsJy8AasZkzkR4apr1cywi1wpP92FOjAN2Oc7GYDYv4NPnXdQ@mail.gmail.com> (raw)
In-Reply-To: <CAODn77oL6sj5zvxgPGw=4TNqmnSeBq4=j2r2nx_51YHooECo7w@mail.gmail.com>

On Tue, Apr 16, 2019 at 1:31 PM Paul Morelle <paul.morelle@gmail.com> wrote:
>> The problem here is the option parser of this command would try to
>> parse all options, so it considers both --quiet the same thing and are
>> to tell "submodule--foreach" to be quiet, the second --quiet is not
>> part of the "git pull" command anymore.
>>
>> So the fix would be to pass "--" to stop option parsing.
>> submodule--helper should not parse options it does not understand
>> anyway. Something like this should work.
>
>
> My expectation as a user (and probably Robin's too) would be that `git submodule foreach` stops parsing arguments at `--` or at the first not-recognized argument, whichever is encountered first. The rest of the arguments would then be considered as the command.

I don't think I change any visible behavior though (or at least trying
not to). There are two command line parsers, the "front" one is in
git-submodule.sh and should do what you describe (or whatever the
current behavior is) and there's an internal one for "git
submodule--helper" which is more like internal API than anything.

The change here is to stop the internal parser from accidentally
interpret options that belong to the foreach's command. The "--" and
first non-recognized argument should be handled correctly by the front
parser.

The exact behavior of this front parser, I can't tell (I'm nowhere
near expert level of submodules) but yeah it should stop at either
`--` or the first non-option argument (e.g. something that does not
start with '-'). An argument that looks like an option (i.e. starts
with '-') but not recognized should result in an error. This is pretty
much standard behavior for all other commands, but I have not tested
this with git-submodule.sh.

> This would slightly break the retrocompatibility, but would also avoid similar bugs in the future.
-- 
Duy

  parent reply	other threads:[~2019-04-16  7:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-20  5:57 regression in output of git-pull --rebase --recurse-submodules=yes --quiet Robin H. Johnson
2018-01-25 19:08 ` [PATCH] builtin/pull: respect verbosity settings in submodules Stefan Beller
2018-01-25 19:18   ` Junio C Hamano
2019-04-10  6:41 ` regression AGAIN in output of git-pull --rebase --recurse-submodules=yes --quiet Robin H. Johnson
2019-04-10 11:18   ` Duy Nguyen
2019-04-12  7:08     ` Robin H. Johnson
2019-04-12  9:25       ` Duy Nguyen
2019-04-15 14:40       ` Johannes Schindelin
     [not found]     ` <CAODn77oL6sj5zvxgPGw=4TNqmnSeBq4=j2r2nx_51YHooECo7w@mail.gmail.com>
2019-04-16  7:48       ` Duy Nguyen [this message]
2019-04-12 10:08   ` [PATCH] submodule foreach: fix "<command> --quiet" not being respected Nguyễn Thái Ngọc Duy
2019-04-12 17:22     ` Robin H. Johnson
2019-04-15  2:59       ` 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=CACsJy8AasZkzkR4apr1cywi1wpP92FOjAN2Oc7GYDYv4NPnXdQ@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paul.morelle@gmail.com \
    --cc=pc44800@gmail.com \
    --cc=robbat2@gentoo.org \
    --cc=stefanbeller@gmail.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).