git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Pat Notz" <patnotz@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv5 2/8] commit.c: new function for looking up a comit by name
Date: Wed, 13 Oct 2010 14:59:26 -0700	[thread overview]
Message-ID: <7viq15iwjl.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 1286478657-61581-3-git-send-email-patnotz@gmail.com

s/comit/commit/;

"Pat Notz" <patnotz@gmail.com> writes:

> diff --git a/commit.c b/commit.c
> index 0094ec1..f51098a 100644
> --- a/commit.c
> +++ b/commit.c
> @@ -49,6 +49,19 @@ struct commit *lookup_commit(const unsigned char *sha1)
>  	return check_commit(obj, sha1, 0);
>  }
>  
> +struct commit *lookup_commit_reference_by_name(const char *name)
> +{
> +	unsigned char sha1[20];
> +	struct commit *commit;
> +
> +	if (get_sha1(name, sha1))
> +		die("could not lookup commit %s", name);
> +	commit = lookup_commit_reference(sha1);
> +	if (!commit || parse_commit(commit))
> +		die("could not parse commit %s", name);
> +	return commit;
> +}

Although this wouldn't _hurt_, not very excited without seeing codepaths
that can use this helper to reduce lines (there should be a lot of places,
I would think).  And when that happens, the helper that dies would not be
very useful, as some potential callers that can benefit may want to decide
what messages to issue themselves.

  reply	other threads:[~2010-10-13 21:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 19:10 [PATCHv5 0/8] Add commit message options for rebase --autosquash Pat Notz
2010-10-07 19:10 ` [PATCHv5 1/8] commit.c: prefer get_header() to manual searching Pat Notz
2010-10-07 21:11   ` Sverre Rabbelier
2010-10-07 21:12     ` Sverre Rabbelier
2010-10-13 21:59   ` Junio C Hamano
2010-10-07 19:10 ` [PATCHv5 2/8] commit.c: new function for looking up a comit by name Pat Notz
2010-10-13 21:59   ` Junio C Hamano [this message]
2010-10-07 19:10 ` [PATCHv5 3/8] pretty.c: helper methods for getting output encodings Pat Notz
2010-10-07 19:10 ` [PATCHv5 4/8] pretty.c: teach format_commit_message() to reencode the output Pat Notz
2010-10-13 21:59   ` Junio C Hamano
2010-10-13 22:44     ` Pat Notz
2010-10-07 19:10 ` [PATCHv5 5/8] commit: --fixup option for use with rebase --autosquash Pat Notz
2010-10-07 19:10 ` [PATCHv5 6/8] add tests of commit --fixup Pat Notz
2010-10-07 19:10 ` [PATCHv5 7/8] commit: --squash option for use with rebase --autosquash Pat Notz
2010-10-07 19:10 ` [PATCHv5 8/8] add tests of commit --squash Pat Notz
2010-10-11 21:06 ` [PATCHv5 0/8] Add commit message options for rebase --autosquash Pat Notz
2010-10-12  9:36   ` Sverre Rabbelier

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7viq15iwjl.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=patnotz@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).