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

Re: [PATCH] tagger id

From
Junio C Hamano <junkio@cox.net>
Date
Jul 12, 2005, 08:44 UTC
Message-ID
<7veka48lcw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<m18y0c1prv.fsf@ebiederm.dsl.xmission.com>
ebiederm@xmission.com (Eric W. Biederman) writes:
> Should this default to git_author_ident or git_committer_ident?
> I'm not really certain how we expect to use the different flavors.

The only in-tree user after your patch is applied is the tagger stuff, so in that sense committer_ident may make more sense. Having said that, for something like this that would not be used constantly and interatively by the users, my preference is not to have any default at all, and always require --author or --committer. You have to type a bit more when doing the script, but that needs to be done only once. You will be sure which one you are asking from the command two weeks after you wrote the script so it is not a big loss.

I am not seriously suggesting the below as an alternative, but have you thought about doing an inverse function of your computation for the case when the user has all the environment variables, and have script eval its output, like this [*1*]:

    $ git-id
    GIT_AUTHOR_NAME='Junio C Hamano'
    GIT_AUTHOR_EMAIL='junkio@cox.net'
    GIT_COMMITTER_NAME='Junio C Hamano'
    GIT_COMMITTER_EMAIL='junkio@cox.net'
    $ eval "`git-id`"
    $ tagger="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"

Having names and emails available separately may turn out to be easier to use in other situation. Just a thought.

By the way, I do not particularly like the name "git-id". There could be IDs for different kinds (not just people) we would want later (file IDs, for example). Naming what you are computing _the_ "id" feels a bit too generic. I do not have a better alternative to suggest, though.

[Footnote]

*1* This makes its output syntax a bit too specific to the shell and unfriendly to Porcelain written in other languages. The only non-shell Porcelains I am aware of are done in Perl (I do not remember hearing its name) and Python (StGIT), both of which have reasonable regexp support to grok something like this, so it would not be a big issue.

Previous: Eric W. BiedermanNext: Eric W. Biederman
Message 15 of 25 in “Trial git RPM's..”
  1. Linus TorvaldsJul 11, 2005
  2. Eric W. BiedermanJul 11, 2005
  3. Linus TorvaldsJul 11, 2005
  4. Chris WrightJul 11, 2005
  5. Eric W. BiedermanJul 12, 2005
  6. Linus TorvaldsJul 12, 2005
  7. Eric W. BiedermanJul 12, 2005
  8. Linus TorvaldsJul 12, 2005
  9. Chris WrightJul 12, 2005
  10. Eric W. BiedermanJul 12, 2005
  11. Linus TorvaldsJul 12, 2005
  12. Eric W. BiedermanJul 12, 2005
  13. tagger idEric W. Biederman, Jul 12, 2005
  14. Eric W. BiedermanJul 12, 2005
  15. Junio C HamanoJul 12, 2005
  16. Eric W. BiedermanJul 12, 2005
  17. Petr BaudisJul 12, 2005
  18. Junio C HamanoJul 12, 2005
  19. Eric W. BiedermanJul 15, 2005
  20. Linus TorvaldsJul 12, 2005
  21. Eric W. BiedermanJul 12, 2005
  22. Junio C HamanoJul 12, 2005
  23. Eric W. BiedermanJul 15, 2005
  24. Eric W. BiedermanJul 12, 2005
  25. Chris WrightJul 11, 2005

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.