Re: [PATCH 1/2] cat-file.c: rename cmdmode to mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"John Cai via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> From: John Cai <johncai86@xxxxxxxxx>
>
> To prepare for a new flag --batch-command, we will add a flag that
> indicates whether or not an interactive command mode will be used
> that reads commands and arguments off of stdin.
>
> An intuitive name for this flag would be "command", which can get
> confusing with the already existing cmdmode.

I am moderately against this change.  "mode" is too vague a word
(i.e. it does not answer "mode of what?" question with the name),
and renaming it to "mode" is probably a regression in readability.

The original name "cmdmode" is not all that better, either, as I am
sure that it was named after the irrelevant implementation detail
that it is originally read using the OPT_CMDMODE() feature of the
parse-options machinery, and did not mean to express mode of doing
"what" with the name.

So, let's think aloud what this "mode" is about.  The feature lets
the batch operation to choose how the blob objects are mangled [*],
so "mangle-mode", "filter-mode", etc. (or find and use a better verb
than these) would be an improvement over the original "cmdmode".


[Footnote]

* 'w' to apply the smudge filter to make them as if they were
  written to the working tree, 'c' to apply the textconv filter, or
  0 to stream them as-is.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux