git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: Re: [PATCH 09/17] builtin/merge: convert to struct object_id
Date: Mon, 2 Jan 2017 15:34:22 +0100	[thread overview]
Message-ID: <f6b59780-a76c-1e13-f983-c0cc767cc2b8@alum.mit.edu> (raw)
In-Reply-To: <20170101191847.564741-10-sandals@crustytoothpaste.net>

On 01/01/2017 08:18 PM, brian m. carlson wrote:
> Additionally convert several uses of the constant 40 into
> GIT_SHA1_HEXSZ.
> 
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
>  builtin/merge.c | 136 ++++++++++++++++++++++++++++----------------------------
>  1 file changed, 68 insertions(+), 68 deletions(-)
> 
> [...]
> @@ -437,25 +437,25 @@ static void merge_name(const char *remote, struct strbuf *msg)
>  	strbuf_branchname(&bname, remote);
>  	remote = bname.buf;
>  
> -	memset(branch_head, 0, sizeof(branch_head));
> +	memset(&branch_head, 0, sizeof(branch_head));

I think this could be

        oidclr(&branch_head);

>  	remote_head = get_merge_parent(remote);
>  	if (!remote_head)
>  		die(_("'%s' does not point to a commit"), remote);
> [...]
> @@ -1113,9 +1113,9 @@ static struct commit_list *collect_parents(struct commit *head_commit,
>  
>  int cmd_merge(int argc, const char **argv, const char *prefix)
>  {
> -	unsigned char result_tree[20];
> -	unsigned char stash[20];
> -	unsigned char head_sha1[20];
> +	struct object_id result_tree;
> +	struct object_id stash;
> +	struct object_id head_oid;

These could comfortably be declared on a single line now.

>  	struct commit *head_commit;
>  	struct strbuf buf = STRBUF_INIT;
>  	const char *head_arg;
> [...]

Michael


  reply	other threads:[~2017-01-02 14:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01 19:18 [PATCH 00/17] object_id part 6 brian m. carlson
2017-01-01 19:18 ` [PATCH 01/17] builtin/commit: convert to struct object_id brian m. carlson
2017-01-01 19:18 ` [PATCH 02/17] builtin/diff-tree: " brian m. carlson
2017-01-01 19:18 ` [PATCH 03/17] builtin/describe: " brian m. carlson
2017-01-01 19:18 ` [PATCH 04/17] builtin/fast-export: " brian m. carlson
2017-01-01 19:18 ` [PATCH 05/17] builtin/fmt-merge-message: " brian m. carlson
2017-01-01 19:18 ` [PATCH 06/17] builtin/grep: " brian m. carlson
2017-01-01 19:18 ` [PATCH 07/17] builtin/branch: " brian m. carlson
2017-01-01 19:18 ` [PATCH 08/17] builtin/clone: " brian m. carlson
2017-01-01 19:18 ` [PATCH 09/17] builtin/merge: " brian m. carlson
2017-01-02 14:34   ` Michael Haggerty [this message]
2017-01-01 19:18 ` [PATCH 10/17] Convert remaining callers of resolve_refdup to object_id brian m. carlson
2017-01-01 19:18 ` [PATCH 11/17] builtin/replace: convert to struct object_id brian m. carlson
2017-01-01 19:18 ` [PATCH 12/17] reflog-walk: convert struct reflog_info " brian m. carlson
2017-01-01 19:18 ` [PATCH 13/17] refs: convert each_reflog_ent_fn " brian m. carlson
2017-01-02 15:07   ` Michael Haggerty
     [not found]     ` <20170102191256.fjqsns3rgjyehzgp@genre.crustytoothpaste.net>
2017-01-02 23:30       ` Michael Haggerty
2017-01-03  1:32         ` Jeff King
2017-01-01 19:18 ` [PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function brian m. carlson
2017-01-02 15:30   ` Michael Haggerty
2017-01-02 17:09     ` Jeff King
2017-01-02 18:18       ` Michael Haggerty
2017-01-02 18:22         ` Jeff King
2017-01-01 19:18 ` [PATCH 15/17] Convert object iteration callbacks to struct object_id brian m. carlson
2017-01-01 19:18 ` [PATCH 16/17] builtin/merge-base: convert " brian m. carlson
2017-01-01 19:18 ` [PATCH 17/17] wt-status: " brian m. carlson
2017-01-02 15:37 ` [PATCH 00/17] object_id part 6 Michael Haggerty

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=f6b59780-a76c-1e13-f983-c0cc767cc2b8@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    /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).