git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charvi Mendiratta <charvi077@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Phillip Wood <phillip.wood123@gmail.com>,
	Christian Couder <chriscool@tuxfamily.org>,
	Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2 04/11] t/lib-rebase: change the implementation of commands with options
Date: Tue, 9 Feb 2021 12:49:05 +0530	[thread overview]
Message-ID: <CAPSFM5fdpvb9uOFpZvy_Le3+33nbq6yE8ZBDxAXBBDgNhYU0dg@mail.gmail.com> (raw)
In-Reply-To: <CAP8UFD1GV2s4SjB3YaT5qiW+E12-hikMEiFoU_LV81aK14g8bA@mail.gmail.com>

> I agree with that, and discussed it with Eric. See:
>
> https://lore.kernel.org/git/CAPig+cSBVG0AdyqXH2mZp6Ohrcb8_ec1Mm_vGbQM4zWT_7yYxQ@mail.gmail.com/
>
> The discussion was:
>
> -----------------------
>
> > > > However, "fixup" is a very different beast. Its arguments are not
> > > > arbitrary at all, so there isn't a good reason to mirror the choice of
> > > > "_" to represent a space, which leads to rather unsightly tokens such
> > > > as "fixup_-C". It would work just as well to use simpler tokens such
> > > > as "fixup-C" and "fixup-c", in which case t/lib-rebase.sh might parse
> > > > them like this (note that I also dropped `g` from the `sed` action):
> > > >
> > > >     fixup-*)
> > > >         action=$(echo "$line" | sed 's/-/ -/');;
> > >
> > > I agree that "fixup" arguments are not arbitrary at all, but I think
> > > it makes things simpler to just use one way to encode spaces instead
> > > of many different ways.
> >
> > Is that the intention here, though? Is the idea that some day `fixup`
> > will accept arbitrary arguments thus needs to encode spaces? If not,
> > then mirroring the treatment given to `exec` confuses readers into
> > thinking that it will/should accept arbitrary arguments. I brought
> > this up in my review specifically because it was confusing to a person
> > (me) new to this topic and reading the patches for the first time. The
> > more specific and exact the code can be, the less likely it will
> > confuse readers in the future.
>
> -----------------------
>
> > So, if I didn't know you folks have invested enough hours in this
> > patch, I would have said not to do this, but it is such a small
> > change, its effect isolated to only those who would be writing tests
> > for "rebase -i", it may be OK to let them endure a bit additional
> > burden to remember an extra rule with this patch.  I dunno.
>
> I would be ok with dropping this patch.

Earlier from the discussions I thought it would be ok to make separate rules for
command taking arbitrary arguments(exec) and the command taking single
option(fixup).

But I also agree we can make the same rules and will remove it.

> It might be a good idea to
> improve the documentation before the function though.

Okay, Maybe we can improve like below:

update the current comment:
# "exec_cmd_with_args" -- add an "exec cmd with args" line.

with:
# "_" -- add a space, like "fixup_-C" implies "fixup -C" and
#        "exec_cmd_with_args" add an "exec cmd with args" line.

Thanks and Regards,
Charvi.

  reply	other threads:[~2021-02-09  7:21 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 18:14 [PATCH 0/7][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase Charvi Mendiratta
2021-02-07 18:14 ` [PATCH 1/7] sequencer: fixup the datatype of the 'flag' argument Charvi Mendiratta
2021-02-07 18:14 ` [PATCH 2/7] sequencer: rename a few functions Charvi Mendiratta
2021-02-07 18:14 ` [PATCH 3/7] rebase -i: clarify and fix 'fixup -c' rebase-todo help Charvi Mendiratta
2021-02-07 18:49   ` Eric Sunshine
2021-02-08  4:30     ` Charvi Mendiratta
2021-02-07 18:14 ` [PATCH 4/7] t/lib-rebase: change the implementation of commands with options Charvi Mendiratta
2021-02-07 18:14 ` [PATCH 5/7] t3437: fix indendation of the here-doc Charvi Mendiratta
2021-02-07 18:54   ` Eric Sunshine
2021-02-08  4:30     ` Charvi Mendiratta
2021-02-08 10:37     ` Phillip Wood
2021-02-07 18:14 ` [PATCH 6/7] t/t3437: update the tests Charvi Mendiratta
2021-02-07 18:43   ` Eric Sunshine
2021-02-08  4:30     ` Charvi Mendiratta
2021-02-07 18:14 ` [PATCH 7/7] doc/rebase -i: fix typo in the documentation of 'fixup' command Charvi Mendiratta
2021-02-07 18:57 ` [PATCH 0/7][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase Eric Sunshine
2021-02-08  4:31   ` Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 00/11][Outreachy] " Charvi Mendiratta
2021-02-08 21:57   ` Junio C Hamano
2021-02-09  7:19     ` Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 01/11] sequencer: fixup the datatype of the 'flag' argument Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 02/11] sequencer: rename a few functions Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help Charvi Mendiratta
2021-02-08 21:24   ` Junio C Hamano
2021-02-09  7:13     ` Charvi Mendiratta
2021-02-09  8:33       ` Eric Sunshine
2021-02-09 19:08         ` Junio C Hamano
2021-02-09 19:13           ` Eric Sunshine
2021-02-10  5:43             ` Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 04/11] t/lib-rebase: change the implementation of commands with options Charvi Mendiratta
2021-02-08 21:36   ` Junio C Hamano
2021-02-08 23:19     ` Christian Couder
2021-02-09  7:19       ` Charvi Mendiratta [this message]
2021-02-08 19:25 ` [PATCH v2 05/11] t/t3437: fix indentation of the here-doc Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 06/11] t/t3437: remove the dependency of 'expected-message' file from tests Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 07/11] t/t3437: check author date of the fixed up commit Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 08/11] t/t3437: simplify and document the test helpers Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 09/11] t/t3437: cleanup the 'setup' test and use named commits in the tests Charvi Mendiratta
2021-02-08 21:41   ` Junio C Hamano
2021-02-09  7:13     ` Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 10/11] t/t3437: fixup the test 'multiple fixup -c opens editor once' Charvi Mendiratta
2021-02-08 19:25 ` [PATCH v2 11/11] doc/rebase -i: fix typo in the documentation of 'fixup' command Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 00/11][Outreachy] Improve the 'fixup [-C | -c]' in interactive rebase Charvi Mendiratta
2021-02-11 17:19   ` Junio C Hamano
2021-02-11 22:26     ` Charvi Mendiratta
2021-02-11 22:44       ` Junio C Hamano
2021-02-12  0:19         ` Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 01/11] sequencer: fixup the datatype of the 'flag' argument Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 02/11] sequencer: rename a few functions Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 03/11] rebase -i: clarify and fix 'fixup -c' rebase-todo help Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 04/11] t/lib-rebase: update the documentation of FAKE_LINES Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 05/11] t/t3437: fixup here-docs in the 'setup' test Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 06/11] t/t3437: remove the dependency of 'expected-message' file from tests Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 07/11] t/t3437: check the author date of fixed up commit Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 08/11] t/t3437: simplify and document the test helpers Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 09/11] t/t3437: use named commits in the tests Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 10/11] t/t3437: fixup the test 'multiple fixup -c opens editor once' Charvi Mendiratta
2021-02-10 11:36 ` [PATCH v3 11/11] doc/rebase -i: fix typo in the documentation of 'fixup' command Charvi Mendiratta

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=CAPSFM5fdpvb9uOFpZvy_Le3+33nbq6yE8ZBDxAXBBDgNhYU0dg@mail.gmail.com \
    --to=charvi077@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=sunshine@sunshineco.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.
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).