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

Re: [PATCH v2 3/4] rebase: stop accepting --rebase-merges=""

From
Alex Henrie <alexhenrie24@gmail.com>
Date
Feb 22, 2023, 23:33 UTC
Message-ID
<CAMMLpeRXYm-Qtr6556fZxmND+stku9cK+aBGr7h7ezw+Mrg=-g@mail.gmail.com>
In-Reply-To
<xmqq8rgpcn8l.fsf@gitster.g>
On Wed, Feb 22, 2023 at 3:18 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 16 quoted lines
>
> On 22/02/2023 01:38, Alex Henrie wrote:
> > On Tue, Feb 21, 2023 at 3:55 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
> >>
> >> Is there a particular reason you decided to redo the option parsing
> >> rather than just calling parse_merges_value() from the existing "if
> >> (rebase_merges)" block? I don't think it really matters, I'm just curious.
> >
> > Without a parse_opt_merges callback, how could we know whether the
> > user passed --no-rebase-merges as opposed to passing nothing at all?
> > const char *rebase_merges would be NULL in either case. It's an
> > important distinction to make because --no-rebase-merges overrides
> > rebase.merges but the absence of a command-line argument does not.
>
> The usual way we handle that is to set the value of rebase_merges from
> the config before calling parse_options(). However your solution is fine.
On Wed, Feb 22, 2023 at 4:08 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
>
> Is it?  If it is not too much to ask, I'd prefer to have code that
> does not surprise people, and "the usual way" you mentioned is what
> readers around here expect to see.  I didn't check and think about
> the patch in quetion, and especially the existing code that the
> patch needs to touch, too deeply, so if it is too convoluted already
> that it would be a lot of work to make it work in "the usual way",
> it may be OK, but otherwise, the solution may not be fine.

There was a const char *rebase_merges in cmd_rebase and an int rebase_merges in struct rebase_options. I deleted const char *rebase_merges, leaving only int rebase_merges. int rebase_merges is set from rebase_config before it is set from parse_options.

Do you want me to add back const char *rebase_merges? If so, where should it be declared so that it can be set from both rebase_config and parse_options?

-Alex
Previous: Junio C HamanoNext: Alex Henrie
Message 13 of 17 in “rebase: document the --no-rebase-merges option”
  1. 1/4 rebase: document the --no-rebase-merges optionAlex Henrie, Feb 21, 2023
  2. 2/4 rebase: add tests for --no-rebase-mergesAlex Henrie, Feb 21, 2023
  3. Phillip WoodFeb 21, 2023
  4. Alex HenrieFeb 22, 2023
  5. Phillip WoodFeb 22, 2023
  6. Alex HenrieFeb 23, 2023
  7. 3/4 rebase: stop accepting --rebase-merges=""Alex Henrie, Feb 21, 2023
  8. Phillip WoodFeb 21, 2023
  9. Alex HenrieFeb 22, 2023
  10. Alex HenrieFeb 22, 2023
  11. Phillip WoodFeb 22, 2023
  12. Junio C HamanoFeb 22, 2023
  13. Alex HenrieFeb 22, 2023
  14. 4/4 rebase: add a config option for --rebase-mergesAlex Henrie, Feb 21, 2023
  15. Phillip WoodFeb 21, 2023
  16. Alex HenrieFeb 22, 2023
  17. Phillip WoodFeb 21, 2023

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.