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

Re: [PATCH 2/3] sha1_name: Suggest commit:./file for path in subdir

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 1, 2011, 19:11 UTC
Message-ID
<7vfwq1g51y.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4D957648.8070008@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 11 quoted lines
> Junio C Hamano venit, vidit, dixit 31.03.2011 21:26:
>> Michael J Gruber <git@drmicha.warpmail.net> writes:
>> 
>>> Currently, the "Did you mean..." message suggests "commit:fullpath"
>>> only. Extend this to show the more convenient "commit:./file" form also.
>> 
>> If we were to do this, I suspect that with non-empty prefix we should only
>> show "./$file" form for brevity without aka.  This is a end-user facing
>> message and not meant to help scripts, no?
>
> ENOPARSE

Sorry. What I meant was to show only "$commit:./$file" (with $commit and $file substituted appropriately so that the user can cut&paste from the output) when we issue this advice in a subdirectory.

This is meant to be a direct and immediate advice to the user who typed it from the command line to tell what he might meant. It is beneficial to teach the user that there are two different ways to spell it, and that in different contexts one of these two ways may be easier to use over the other way, but this is not a place to do so.

We know the context and what the user wanted to do (iow, the command is run in a subdirectory, and we already guessed that the user probably wanted to name the path in that subdirectory), so we already know between two forms, ./$path_around_here form, not the $prefix/$path_around_here form, is more appropriate, no?

Previous: Michael J GruberNext: Michael J Gruber
Message 7 of 29 in “Usability improvement request: git show revision -- file”
  1. Piotr KrukowieckiMar 31, 2011
  2. Michael J GruberMar 31, 2011
  3. 1/3 t1506: factor out test for "Did you mean..."Michael J Gruber, Mar 31, 2011
  4. 2/3 sha1_name: Suggest commit:./file for path in subdirMichael J Gruber, Mar 31, 2011
  5. Junio C HamanoMar 31, 2011
  6. Michael J GruberApr 1, 2011
  7. Junio C HamanoApr 1, 2011
  8. 3/3 builtin/show.c: do not prune by pathspecMichael J Gruber, Mar 31, 2011
  9. Johannes SixtMar 31, 2011
  10. Michael J GruberMar 31, 2011
  11. Johannes SixtMar 31, 2011
  12. Michael J GruberMar 31, 2011
  13. Nguyen Thai Ngoc DuyMar 31, 2011
  14. Michael J GruberMar 31, 2011
  15. Nguyen Thai Ngoc DuyMar 31, 2011
  16. Michael J GruberMar 31, 2011
  17. Junio C HamanoMar 31, 2011
  18. Michael J GruberApr 1, 2011
  19. 0/4 reflog, show and command line overridesMichael J Gruber, Apr 1, 2011
  20. 1/4 builtin/log.c: separate default and setup of cmd_log_init()Michael J Gruber, Apr 1, 2011
  21. 2/4 t/t1411: test reflog with formatsMichael J Gruber, Apr 1, 2011
  22. 3/4 reflog: fix overriding of command line optionsMichael J Gruber, Apr 1, 2011
  23. 4/4 builtin/show: do not prune by pathspecMichael J Gruber, Apr 1, 2011
  24. Junio C HamanoApr 1, 2011
  25. Junio C HamanoApr 1, 2011
  26. Michael J GruberApr 3, 2011
  27. Junio C HamanoApr 4, 2011
  28. Michael J GruberApr 5, 2011
  29. Piotr KrukowieckiMar 31, 2011

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.