From patchwork Wed Sep 25 02:01:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Henrie X-Patchwork-Id: 11159911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77E2017D4 for ; Wed, 25 Sep 2019 02:04:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AB9B2146E for ; Wed, 25 Sep 2019 02:04:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oByAD5Lr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633764AbfIYCEs (ORCPT ); Tue, 24 Sep 2019 22:04:48 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45289 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389401AbfIYCEs (ORCPT ); Tue, 24 Sep 2019 22:04:48 -0400 Received: by mail-io1-f68.google.com with SMTP id c25so9465401iot.12 for ; Tue, 24 Sep 2019 19:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s/BUQK4TBWTerPsbwVxt4e3h1Zpptorjgr+lA2TqEFc=; b=oByAD5LrnpOHbmg61Mwo28DkdfwXU+FtDHzhtdY9uqLuPitjX67LeUnppnvRF3NQkh 065Ma7+hJAMJAWr0LS4Yokup5pqDhcBPfjEX951l6mq7vM46JN3tuFysRqztKe4EFtou ltS3xOuVaLJvBW+/f1PZ+33GHKDvnWyKL5kCzO9kzsIG2pkSUvDyJqBc56Deq+JYLm4Z iqZtVtxvCURBw3TTKvViEG+YK1LmqWv8ExoTnL3bOwwpzGM0OknKHYI6MLgk+3/O05ZD L2S3ucpS2ghpT44ilDd3C7iECXMkyCS0K3ZfpLWgfK8EZKNpXDgp10d8rwgH4hGAEjSS T1NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s/BUQK4TBWTerPsbwVxt4e3h1Zpptorjgr+lA2TqEFc=; b=CJJqxeTBxCV9np0e4lDgq/s+yRGJpVBKFZzkMU6s2vS3nC4rtULX+7YIFUHyZOLsHa RHc8tXaR7LIYJs9qkxh0BpEIIz+WTQryBGygS/HC3MnpA+ZZunwfWgSUFqnia+F9nwLl uHK29xNquYzYnOX0XwBsF49DEM/XlPJhM3s/W7VcS65yBTeP1+Jt42pMcfW06rUZx5iJ FXiO+j0M8YlWn8txAMj/e1VkWz+K67RXHjVwo65i81Jc+nT0iAVKyh21lcn64xlFJueG D6dphU9hyWOS4iVEAARtIVoKcivBX+QRMEv7L2REnFLTPSjyHwrR1T8hiC8qY393Sqjv sL5Q== X-Gm-Message-State: APjAAAV9+hmQMXPDwY7Pll757/BpO5a3VDmiYYfrPqQ6Y8yRyzrveLoT FXSfCMwCRhqbsBxIgwEjFVmmkg8nSJk= X-Google-Smtp-Source: APXvYqxGWYtEwtK/BdRU+iYTbFcXD96iCdkRp6DMxeWjoJhz7yeA6BsgGE6LSYeSNkJODVG3qEWHmQ== X-Received: by 2002:a02:aa8f:: with SMTP id u15mr2611065jai.13.1569377086678; Tue, 24 Sep 2019 19:04:46 -0700 (PDT) Received: from xavier.hsd1.ut.comcast.net ([2601:681:4100:375e:3837:c90c:13fa:5c01]) by smtp.gmail.com with ESMTPSA id u11sm5341777iof.22.2019.09.24.19.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 19:04:45 -0700 (PDT) From: Alex Henrie To: git@vger.kernel.org, dstolee@microsoft.com, gitster@pobox.com, davvid@gmail.com Cc: Alex Henrie Subject: [PATCH 1/3] commit-graph: remove a duplicate assignment Date: Tue, 24 Sep 2019 20:01:56 -0600 Message-Id: <20190925020158.751492-2-alexhenrie24@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190925020158.751492-1-alexhenrie24@gmail.com> References: <20190925020158.751492-1-alexhenrie24@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Alex Henrie --- commit-graph.c | 1 - 1 file changed, 1 deletion(-) diff --git a/commit-graph.c b/commit-graph.c index 9b02d2c426..659f4bb4f4 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -1534,7 +1534,6 @@ static void split_graph_merge_strategy(struct write_commit_graph_context *ctx) size_mult = ctx->split_opts->size_multiple; } - g = ctx->r->objects->commit_graph; ctx->num_commit_graphs_after = ctx->num_commit_graphs_before + 1; while (g && (g->num_commits <= size_mult * num_commits || From patchwork Wed Sep 25 02:01:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Henrie X-Patchwork-Id: 11159913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D28C817D4 for ; Wed, 25 Sep 2019 02:04:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE57C214AF for ; Wed, 25 Sep 2019 02:04:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VZJjPY3a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633767AbfIYCEt (ORCPT ); Tue, 24 Sep 2019 22:04:49 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:40416 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389401AbfIYCEt (ORCPT ); Tue, 24 Sep 2019 22:04:49 -0400 Received: by mail-io1-f67.google.com with SMTP id h144so9486470iof.7 for ; Tue, 24 Sep 2019 19:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cmlAnId5uOeqD/XQrHWfTtuselPEYcKCUq1oSjO0Xng=; b=VZJjPY3aOLFLrIVIqu3xUfL1DPPW6BCDKuDIjaEItb+Fjvpv0S2VHwPQIT8EcKVU6m HTf3w7voLw/avraoh+QfJtTHhgqWfGadA2gswDRp4LQ0/DCnsebHXmg3dnOm3K9DisTF uCucROHGPYkPyl+9jcymPlAuN2NXHmubBWS+xepb6GT+mFs+Vy3tlmP7ew25CHOibOUI WkzbszEa+gZK3KZS4Cu2cF9UjwA9EkqA3UGLY3wN2kgVV91vcBWjyVZXbulPqdH6KTo8 j7nLlNYYCfolFePM2sUYvK65CQgQBud99jvHfYiZ+LK97IzhlITenro8BUqVwHbH3zh1 yaUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cmlAnId5uOeqD/XQrHWfTtuselPEYcKCUq1oSjO0Xng=; b=nlIXs14DBQ91YR9YF1dQS2+lO1EHC2Z4E+U87eCpxpVQrgHY8n+E0BkMQQXwo03f7M DmMoCIGOa2CKzVYdmYXW2V3ocpdcvx5FodJszAoBb8wnxm46hlfUSL+6tE5cp6JWhPLo 8ZG6aNMCXkerIekaBUJiLDg9pHa105t2E5uwcI1UrJGUMtIFB79Ya/nFd4mk8qsDB8Iq GW9OvLzN3QZsjenHTMV5DAQUNQT5M0zjFK/FrdsMohchJeb5MxZBc78Rt+s5hFi+r97I TwROwlB14sev4e1h5OR3v2wSxXUM5H+H8bg5RsNvVHalXBOdRaKPEAVOUtYqk9y818mz brxA== X-Gm-Message-State: APjAAAVbS+pZycaUPAIIyqY6nvuGB3uaN44mPxn10QKB8CG5Dj4EcfTB Kys7Qd1b/fSCBvMhzTMe07/90ZPAkL8= X-Google-Smtp-Source: APXvYqyp+tJaD/Uy/Y4FCHlxEDBsmWTqO3SnjAcaB9+Ut1Ex1Yngtt9n5FzQ4Lx8SMfQZwegHsXA8Q== X-Received: by 2002:a6b:6c06:: with SMTP id a6mr7108886ioh.306.1569377088090; Tue, 24 Sep 2019 19:04:48 -0700 (PDT) Received: from xavier.hsd1.ut.comcast.net ([2601:681:4100:375e:3837:c90c:13fa:5c01]) by smtp.gmail.com with ESMTPSA id u11sm5341777iof.22.2019.09.24.19.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 19:04:47 -0700 (PDT) From: Alex Henrie To: git@vger.kernel.org, dstolee@microsoft.com, gitster@pobox.com, davvid@gmail.com Cc: Alex Henrie Subject: [PATCH 2/3] diffcore-break: use a goto instead of a redundant if statement Date: Tue, 24 Sep 2019 20:01:57 -0600 Message-Id: <20190925020158.751492-3-alexhenrie24@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190925020158.751492-1-alexhenrie24@gmail.com> References: <20190925020158.751492-1-alexhenrie24@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Alex Henrie --- diffcore-break.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/diffcore-break.c b/diffcore-break.c index 875aefd3fe..f6ab74141b 100644 --- a/diffcore-break.c +++ b/diffcore-break.c @@ -286,18 +286,17 @@ void diffcore_merge_broken(void) /* Peer survived. Merge them */ merge_broken(p, pp, &outq); q->queue[j] = NULL; - break; + goto done; } } - if (q->nr <= j) - /* The peer did not survive, so we keep - * it in the output. - */ - diff_q(&outq, p); + /* The peer did not survive, so we keep + * it in the output. + */ } - else - diff_q(&outq, p); + diff_q(&outq, p); } + +done: free(q->queue); *q = outq; From patchwork Wed Sep 25 02:01:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Henrie X-Patchwork-Id: 11159915 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 936F914E5 for ; Wed, 25 Sep 2019 02:04:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71A46214AF for ; Wed, 25 Sep 2019 02:04:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Oj/1HM56" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633770AbfIYCEv (ORCPT ); Tue, 24 Sep 2019 22:04:51 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:38721 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389401AbfIYCEu (ORCPT ); Tue, 24 Sep 2019 22:04:50 -0400 Received: by mail-io1-f65.google.com with SMTP id u8so9506772iom.5 for ; Tue, 24 Sep 2019 19:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=emP8HLXIdhnDe1CO0mklPRn7VoRC1V/45QLG5AAMtKE=; b=Oj/1HM5680bd0eAatyiD6P1Aw4IARxax1t0exeYZzovSmzQxP6Pam3jW9Tz1HDiaZ4 p80OYiDpnuXE0EzxffOnFWhNRwRjnclO8ZP0FdVlSnnh2HZhuA62uoqk6RTc+/WRz1/R ViRBf1rmJcegvCiD1knmR/XuelsmaQrU2+nbjct3r+5adJ7HZ8CbUXyioEPvlGiWSMdX 6pw6diNHdjzcHt0kL5mJ3op9BYHG1zTcJPyw5fmXmjL9epo3XRQPvXzt7/U8gsVk+sGB ZJUDaGRgp4Tooy1sAg2nXgb6eYYuSMBF6+9t+UU0Bgn8HSXh8LwEPBjOToNdnzKRC8M/ yfpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=emP8HLXIdhnDe1CO0mklPRn7VoRC1V/45QLG5AAMtKE=; b=efA+rTjvqKeTxqHX3wZYA3ZAcxHrVGsy8YBiWQo4yr8kJLimqLSZoUxHvET61f2p6a CHKnOqzF676ogJjuJU++o81W8198xqzBJ6AF09/woF5pHd4iC50ocxVdePHWw7bKRPTq w6PPBoVvBTj1Yp/wdlM5GCYTux8sQE8HGy3eyoFoZWPCVdMVqnn6v+CB9PUdZw53J4TW iAWvpDFSWI1eGm2T5ZHY0119PQ5UU7EwfFI46jKvzwToyvi03lO+z953Cnbzz8BJZZGT hrZbs5QxO+ONG9Y0RTkykk6jM9v7XqgZSbekq8jhozAZ0Ix5xtGLbi7MvdeYCjmIQdD3 +LkQ== X-Gm-Message-State: APjAAAWKLYKGY9+cwRcrYLCn+VNB1ILdSOd4+GBPMoDEd/JQC5zwd5d7 ZkFYzV1zav6VoiMH6SCYYCftt7+spCE= X-Google-Smtp-Source: APXvYqx/r2GvnSbIW5eKYkUaFy5GDgUbwdchc6VEkMCBWXZURXoZqxqUrloAZkTei4tWycRDfCMrPg== X-Received: by 2002:a05:6602:10d:: with SMTP id s13mr6966440iot.244.1569377089537; Tue, 24 Sep 2019 19:04:49 -0700 (PDT) Received: from xavier.hsd1.ut.comcast.net ([2601:681:4100:375e:3837:c90c:13fa:5c01]) by smtp.gmail.com with ESMTPSA id u11sm5341777iof.22.2019.09.24.19.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 19:04:48 -0700 (PDT) From: Alex Henrie To: git@vger.kernel.org, dstolee@microsoft.com, gitster@pobox.com, davvid@gmail.com Cc: Alex Henrie Subject: [PATCH 3/3] wrapper: use a loop instead of repetitive statements Date: Tue, 24 Sep 2019 20:01:58 -0600 Message-Id: <20190925020158.751492-4-alexhenrie24@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190925020158.751492-1-alexhenrie24@gmail.com> References: <20190925020158.751492-1-alexhenrie24@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Alex Henrie Signed-off-by: Jeff King --- wrapper.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wrapper.c b/wrapper.c index c55d7722d7..c23ac6adcd 100644 --- a/wrapper.c +++ b/wrapper.c @@ -469,13 +469,12 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode) filename_template = &pattern[len - 6 - suffix_len]; for (count = 0; count < TMP_MAX; ++count) { uint64_t v = value; + int i; /* Fill in the random bits. */ - filename_template[0] = letters[v % num_letters]; v /= num_letters; - filename_template[1] = letters[v % num_letters]; v /= num_letters; - filename_template[2] = letters[v % num_letters]; v /= num_letters; - filename_template[3] = letters[v % num_letters]; v /= num_letters; - filename_template[4] = letters[v % num_letters]; v /= num_letters; - filename_template[5] = letters[v % num_letters]; v /= num_letters; + for (i = 0; i < 6; i++) { + filename_template[i] = letters[v % num_letters]; + v /= num_letters; + } fd = open(pattern, O_CREAT | O_EXCL | O_RDWR, mode); if (fd >= 0)