git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@osdl.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] tagger id
Date: Tue, 12 Jul 2005 00:50:44 -0600	[thread overview]
Message-ID: <m18y0c1prv.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <m1slyk63k2.fsf_-_@ebiederm.dsl.xmission.com> (Eric W. Biederman's message of "Mon, 11 Jul 2005 22:39:25 -0600")

ebiederm@xmission.com (Eric W. Biederman) writes:

> 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...

> 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);

>  
>  	/* 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

  reply	other threads:[~2005-07-12  6:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11  1:18 Trial git RPM's Linus Torvalds
2005-07-11 15:24 ` Eric W. Biederman
2005-07-11 17:06   ` Linus Torvalds
2005-07-11 20:11     ` Horst von Brand
2005-07-11 21:03     ` Chris Wright
2005-07-12 15:59       ` Eric W. Biederman
2005-07-12 17:01         ` Linus Torvalds
2005-07-12 17:14           ` Eric W. Biederman
2005-07-12 17:27             ` Linus Torvalds
2005-07-12 17:46               ` Chris Wright
2005-07-12  0:55     ` Eric W. Biederman
2005-07-12  1:15       ` Linus Torvalds
2005-07-12  2:39         ` Eric W. Biederman
2005-07-12  4:39         ` [PATCH] tagger id Eric W. Biederman
2005-07-12  6:50           ` Eric W. Biederman [this message]
2005-07-12  8:44             ` Junio C Hamano
2005-07-12 15:04               ` Eric W. Biederman
2005-07-12 15:14                 ` Petr Baudis
2005-07-12 21:16                 ` Junio C Hamano
2005-07-15  0:46                   ` Eric W. Biederman
2005-07-12 18:54             ` Linus Torvalds
2005-07-12 22:15               ` Eric W. Biederman
2005-07-12 23:42                 ` Junio C Hamano
2005-07-15  0:36                   ` Eric W. Biederman
2005-07-12  0:58     ` Trial git RPM's Eric W. Biederman
2005-07-11 20:34   ` Chris Wright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m18y0c1prv.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).