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

Re: [PATCH] tagger id

From
Eric W. Biederman <ebiederm@xmission.com>
Date
Jul 12, 2005, 06:50 UTC
Message-ID
<m18y0c1prv.fsf@ebiederm.dsl.xmission.com>
In-Reply-To
<m1slyk63k2.fsf_-_@ebiederm.dsl.xmission.com>
ebiederm@xmission.com (Eric W. Biederman) writes:
Show 13 quoted lines
> This patch adds a command git-id for use on
> the command line to see what git will set your id too,
> and for use in scripts (git-tag-script) so they can get your git id.
>
> The common code for computing the git-id is moved to ident.c
>
> Fix parse_date to not mind being passed a constant date
> to parse.
>
> The code to compute the identifier has been restructured
> to at least make a reasonable stab at error handling.  The
> original version had so many unchecked return values it was
> just scary to think about.
Well except for a small bug, but serious bug...
Show 13 quoted lines
> diff --git a/commit-tree.c b/commit-tree.c
> --- a/commit-tree.c
> +++ b/commit-tree.c
> @@ -184,8 +126,8 @@ int main(int argc, char **argv)
>  		add_buffer(&buffer, &size, "parent %s\n",
> sha1_to_hex(parent_sha1[i]));
>  
>  	/* Person/date information */
> -	add_buffer(&buffer, &size, "author %s <%s> %s\n", gecos, email, date);
> - add_buffer(&buffer, &size, "committer %s <%s> %s\n\n", commitgecos,
> commitemail, realdate);
> +	add_buffer(&buffer, &size, "author %s <%s> %s\n", author);
> +	add_buffer(&buffer, &size, "committer %s <%s> %s\n\n", committer);
This should be:
> +	add_buffer(&buffer, &size, "author %s\n", author);
> +	add_buffer(&buffer, &size, "committer %s\n\n", committer);
Show 22 quoted lines
>  
>  	/* And add the comment */
>  	while (fgets(comment, sizeof(comment), stdin) != NULL)
> diff --git a/id.c b/id.c
> new file mode 100644
> --- /dev/null
> +++ b/id.c
> @@ -0,0 +1,36 @@
> +#include "cache.h"
> +#include <stdio.h>
> +#include <errno.h>
> +#include <string.h>
> +
> +static char *id_usage = "git-id [--author | --committer]";
> +
> +int main(int argc, char **argv)
> +{
> +	char buf[1000];
> +	int (*ident)(char *buf, size_t bufsize);
> +	int i;
> +
> +	ident = git_committer_ident;

Should this default to git_author_ident or git_committer_ident? I'm not really certain how we expect to use the different flavors.

Eric
Previous: Eric W. BiedermanNext: Junio C Hamano
Message 14 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.