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

Re: ':/<oneline prefix>' notation doesn't support full file syntax

From
DHDana How <danahow@gmail.com>
Date
Jul 3, 2008, 18:27 UTC
Message-ID
<56b7f5510807031127j10e33f3bl516180f7a9b5b5db@mail.gmail.com>
In-Reply-To
<279b37b20807030150t2e9cbcc8wf099a5872568af8@mail.gmail.com>
On Thu, Jul 3, 2008 at 1:50 AM, Eric Raible <raible@gmail.com> wrote:
Show 11 quoted lines
> On Thu, Jul 3, 2008 at 1:34 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> "Eric Raible" <raible@gmail.com> writes:
>>
>> Is there anything to fix?  In that example, you are looking for a commit
>> that talks about "object name:sha1_name.c" in the comment.
>
> Yes.  What if I'm looking for specific file (i.e. sha1_name.c) in the commit
> described by ":/object name:", just like I can do with 28a4d9404:sha1_name.c?
>
> This is not ambiguous if we first consider the entire string as the prefix.
> If that fails we look for a filename after the final ':'.

In part you are proposing this because it is a consistent extension. But a problem with the current :/string is that it adds 2nd meanings to both : and / , which is not all that consistent to start with.

Last year Junio proposed that :/ be changed to ?
to eliminate the overloading;  thus your proposal becomes:
  ?string:filename
He chose ? because it results in a search backwards through commits.
(You could make that ?string?:filename if you prefer,  where the 2nd ?
 is only needed if you include a filename.)

I was surprised to see Dscho advocating removing this feature altogether. Others proposed other command sequences which avoided :/ . If :/ is now going to be extended and thus perhaps more likely to appear in scripts, is now the time to change it to ? which has no other special meaning to git?

Thanks,
-- 
Dana L. How danahow@gmail.com +1 650 804 5991 cell
Previous: Johannes SchindelinNext: Junio C Hamano
Message 5 of 9 in “':/<oneline prefix>' notation doesn't support full file syntax”
  1. Eric RaibleJul 3, 2008
  2. Junio C HamanoJul 3, 2008
  3. Eric RaibleJul 3, 2008
  4. Johannes SchindelinJul 3, 2008
  5. Dana HowJul 3, 2008
  6. Junio C HamanoJul 3, 2008
  7. Johannes SchindelinJul 4, 2008
  8. Johannes SchindelinJul 4, 2008
  9. Jeff KingJul 3, 2008

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.