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

Re: Commiting automatically (2)

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 27, 2010, 12:04 UTC
Message-ID
<201012271304.03915.jnareb@gmail.com>
In-Reply-To
<4D1190A6.4070201@seznam.cz>
On Wed, 22 Dec 2010, Maaartin-1 wrote:
Show 7 quoted lines
> On 10-12-21 14:06, Jakub Narebski wrote:
>>
>> Please try to not cull Cc list (use 'reply via email', if possible)
> 
> I don't know what "cull" means and
> http://dictionary.reference.com/browse/cull
> doesn't help me at all. Could you explain?
http://en.wiktionary.org/wiki/cull
  to cull
  [...]
  3. To select animals from a group and then kill them in order to
     reduce the numbers of the group in a controlled manner.

In the context ("to cull Cc list") it means removing entries from Cc list (courtesy copy, copy-to), i.e. not replying to all people participating in given (sub)thread.

Show 12 quoted lines
>> Maaartin <grajcar1@seznam.cz> writes:
>> 
>>> I let the snapshot point to the current head, which is where I get a problem now:
>>>
>>>   git show-ref HEAD
>>>
>>> returns nothing,
>>>
>>>   git show-ref --head
>>>
>>> returns HEAD and all branches and tags. Isn't it a bug? How can I get the HEAD 
>>> reference? I'm using git version 1.7.2.3 on cygwin.
[...]
Show 17 quoted lines
>> As for `git show-ref HEAD` - git-show-ref uses its own way of pattern
>> matching; in new enough version of git-show-ref manpage you can read
>> that:
>> 
>>   <pattern>...::
>> 
>>         Show references matching one or more patterns. Patterns are matched from
>>         the end of the full name, and only complete parts are matched, e.g.
>>         'master' matches 'refs/heads/master', 'refs/remotes/origin/master',
>>         'refs/tags/jedi/master' but not 'refs/heads/mymaster' nor
>>         'refs/remotes/master/jedi'.
>> 
>> So `git show-ref HEAD` would match 'refs/.../HEAD`, e.g. `refs/remotes/origin/HEAD`,
>> but not `HEAD` which is outside `refs/`.
> 
> IMHO, it's quite broken. Alone it would be fine, but should really
> git-show-ref behave that different from git-symbolic-ref?

git-symbolic-ref is about querying and manipulating _single_ symbolic reference, using fully qualified branch names (ref names).

git-show-ref is about querying multiple refs; I think the design goal behind its strange pattern matching semantic is to make it easy to get all refs with the same short name.

Show 6 quoted lines
> Moreover, git-show-ref --head shows all branches and tags, this can't be
> right, can it? According to your above explanation, getting HEAD using a
> pattern is impossible, so I'd say that's what is "--head" good for.
> 
> Moreover, "git-show-ref --heads" shows less than "git-show-ref --head",
> despite the plural.

"git show-ref --head" is strange in that it doesn't play well with '--heads' and '--tags' and '<pattern>'.

I think it is a bit of misdesign, but I don't know how it should be fixed; current output of "git show-ref --head" has to be kept because of backward compatibility - git-show-ref is plumbing.

>> I tripped over strange git-show-ref <pattern> semantic too.
>> 
>> P.S. there is also git-for-each-ref.

I don't know why there is git-show-ref when we have git-for-each-ref for scripting; I guess they were added nearly at the same time...

-- 
Jakub Narebski
Poland
Previous: Jakub NarebskiNext: Maaartin-1
Message 11 of 13 in “Commiting automatically (2)”
  1. MaaartinDec 19, 2010
  2. Taylor HedbergDec 19, 2010
  3. Jonathan NiederDec 19, 2010
  4. Jonathan NiederDec 19, 2010
  5. MaaartinDec 20, 2010
  6. Junio C HamanoDec 19, 2010
  7. MaaartinDec 20, 2010
  8. Enrico WeigeltDec 20, 2010
  9. MaaartinDec 21, 2010
  10. Jakub NarebskiDec 21, 2010
  11. Jakub NarebskiDec 27, 2010
  12. Maaartin-1Jan 3, 2011
  13. Jakub NarebskiJan 3, 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.