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

Re: [PATCH 2/2] attr: add flag `-r|--revisions` to work with revisions

From
Karthik Nayak <karthik.188@gmail.com>
Date
Dec 7, 2022, 11:05 UTC
Message-ID
<CAOLa=ZTSzUh2Ma_EMHHWcDunGyKMaUW9BaG=QdegtMqLd+69Wg@mail.gmail.com>
In-Reply-To
<CAPig+cT_xz3m-3kkL_Scf0opNXkikU94kSF46VO8KHkNMWbGzg@mail.gmail.com>
Hey Eric,
On Wed, Dec 7, 2022 at 2:10 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 31 quoted lines
>
> On Tue, Dec 6, 2022 at 7:15 PM Junio C Hamano <gitster@pobox.com> wrote:
> > Karthik Nayak <karthik.188@gmail.com> writes:
> > > Add a new flag `--revision`/`-r` which will allow it work with
> > > revisions. This command will now, instead of checking the files/index,
> > > try and receive the blob for the given attribute file against the
> > > provided revision. The flag overrides checking against the index and
> > > filesystem and also works with bare repositories.
> >
> > As "check-attr" was not invented as a user-facing subcommand but was
> > a hack for debugging, I would have minded this change, but these
> > days people seem to treat it as if it is just one of the proper
> > plumbing commands, the new command line convention bothers me a
> > bit.  No other command uses --<anything> to signal that what comes
> > after it is a rev.
> >
> > But I do not think of a better alternative without making the
> > command line ambiguous, so I'll stop at raising a concern, so that
> > others who may be better at UI can come up with one.
>
> A few minor comments...
>
> We don't usually squat on short options, such as `-r`, right from the
> start but only add the short alias once shown that there is demand.
>
> Option `-r` has strong association with "recursive" elsewhere, so I'd
> worry about giving it such a completely different meaning here.
>
> Rather than calling the option `--revision`, perhaps pattern it after
> git-restore's `--source` option which allows specifying a particular
> commit, tree, tag, etc.?

I'm okay with removing the shortform `-r`. I decided to use `-r|--revision` because it is also used in `git svn`.

I don't have strong feeling about the naming here, but I do feel that `-r|--revision` sounds better than `--source`, because source doesn't directly imply a revision and in the context of `git check-attr` is a bit ambiguous because it could imply the source regarding which `gitattributes` file to check against (although this feature doesn't exist).

-- 
- Karthik
Previous: Eric SunshineNext: Karthik Nayak
Message 8 of 17 in “check-attr: add support to work with revisions”
  1. 0/2 check-attr: add support to work with revisionsKarthik Nayak, Dec 6, 2022
  2. 1/2 t0003: move setup for `--all` into new blockKarthik Nayak, Dec 6, 2022
  3. 2/2 attr: add flag `-r|--revisions` to work with revisionsKarthik Nayak, Dec 6, 2022
  4. Ævar Arnfjörð BjarmasonDec 6, 2022
  5. Karthik NayakDec 6, 2022
  6. Junio C HamanoDec 7, 2022
  7. Eric SunshineDec 7, 2022
  8. Karthik NayakDec 7, 2022
  9. Karthik NayakDec 7, 2022
  10. Ævar Arnfjörð BjarmasonDec 7, 2022
  11. Karthik NayakDec 7, 2022
  12. Ævar Arnfjörð BjarmasonDec 7, 2022
  13. Karthik NayakDec 7, 2022
  14. Philip OakleyDec 6, 2022
  15. Karthik NayakDec 6, 2022
  16. Taylor BlauDec 7, 2022
  17. brian m. carlsonDec 7, 2022

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.