* Re: cogito remote branch
From: MichaelTiloDressel @ 2007-11-09 13:51 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: git
In-Reply-To: <47345E85.8090702@op5.se>
Such a pity. We just got used to it.
-----Original Message-----
Date: Fri, 09 Nov 2007 14:20:05 +0100
Subject: Re: cogito remote branch
From: Andreas Ericsson
To: "MichaelTiloDressel@t-online.de"
MichaelTiloDressel@t-online.de wrote:
> Hi,
>
> I just saw the scripts cg-update, cg-push .. scripts try to guess a
> branch name functioning as origin if no argument is given. These
scripts
> seam to use a branch named -origin if it exists and the
> current
> branch is named and is not the branch named master.
>
> I like that feature. Is it anywhere documented?
>
> In case there is no branch named -origin the scripts just
> use origin even if the current branch is not master. I would prefer
the
> scripts to fail in this case and to print a message asking the user to
> specifically name a branch.
>
Cogito is deprecated, and has been for quite some time. The "remote"
feature of core git (inspired by cogito) offers similar benefits.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: corrupt object on git-gc
From: Andreas Ericsson @ 2007-11-09 13:46 UTC (permalink / raw)
To: Yossi Leybovich; +Cc: git, Yossi Leybovich
In-Reply-To: <4fe79b4b0711090538wf483ce7j89c518962e89780e@mail.gmail.com>
Yossi Leybovich wrote:
> Yossi Leybovich wrote:
>>> Hi
>>>
>>> I know its loose but still I think there are references in the
>>> repository to this object.
>>> How I can remove it from the repository ?
>>>
>
>> That was not a very good idea. You just moved ALL objects whose hash
>> begin with 4b out of the object database.
>
>> Try only moving the offending file out of the 4b directory.
>
> Did not help still the repository look for this object?
> Any one know how can I track this object and understand which file is it
>
Is this a super-secret project or you can make a tarball of the .git
directory and send it to me? Trying to track down the cause through
email is decidedly slow.
>
>
> ib]$ mv .git/objects/4b/9458b3786228369c63936db65827de3cc06200 ../
>
> ib]$ git-fsck --full
> dangling commit 0d43a63623237385e432572bf61171713dcd8e98
> dangling commit 4fc6b1127e4a7f4ff5b65a2dd8a90779b5aff3e0
> dangling commit 7da607374fe2b1ae09228d2035dd608c73dad7c8
> dangling commit 004ef09ae022c60a30f9cd61f90d18df5db3628e
> dangling commit 85112c6fabb6b8913ab244a8645d67380616eba6
> broken link from tree 2d9263c6d23595e7cb2a21e5ebbb53655278dff8
> to blob 4b9458b3786228369c63936db65827de3cc06200
One tree uses the object. I'm not sure if any commit-objects
use the tree. Try
for b in $(git branch --no-color -a | cut -b3-); do
for rev in $(git rev-list HEAD); do
git ls-tree -r $rev | grep -q 2d9263c6d23595e7cb2a21e5ebbb53655278dff8
test $? -eq 0 && echo $rev && break
done
done
If it turns up empty, you *should* be able to safely delete
2d9263c6d23595e7cb2a21e5ebbb53655278dff8 and
4b9458b3786228369c63936db65827de3cc06200
Make sure to take a backup first though.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: [PATCH 3/9] msm: timer support using the GPT and DGT timers
From: Brian Swetland @ 2007-11-09 13:39 UTC (permalink / raw)
To: Uwe Kleine-König, linux-arm-kernel, git
In-Reply-To: <20071109131930.GA19343@bre-cln-ukleine.digi.com>
[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]
[Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>]
>
> Hello Brian,
>
> [adding git ML to Cc:]
>
> > > Content-Type: text/plain; charset=utf-8
> > > Content-Transfer-Encoding: 8bit
> >
> > Mine do not seem to.
> I think they are only generated if the content contains non-ASCII. So
> the attached example isn't very helpful.
Looking at more of the patches (sorry about sending one not exhibiting
the problem -- I picked a small one, forgetting that not all of them
had Arve's name as the author), it looks like the body is plain 7bit
ascii, but the From header has the utf-8 content:
>From 0ac8027053bb686c19a412f0f22f4a305a77ab59 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
Date: Wed, 7 Nov 2007 22:17:29 -0800
Subject: [PATCH 3/9] msm: timer support using the GPT and DGT timers
When sent with git-send-email, the From: line above ended up in the
message, unescaped as utf-8 text, but the generated email itself did
not have any encoding specified. I didn't
Attached is the original patch and the message that resulted when I
used git-send-email to mail the patch to myself.
Brian
[-- Attachment #2: 0003-msm-timer-support-using-the-GPT-and-DGT-timers.patch --]
[-- Type: text/x-diff, Size: 6751 bytes --]
>From 0ac8027053bb686c19a412f0f22f4a305a77ab59 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
Date: Wed, 7 Nov 2007 22:17:29 -0800
Subject: [PATCH 3/9] msm: timer support using the GPT and DGT timers
Signed-off-by: Brian Swetland <swetland@android.com>
---
arch/arm/mach-msm/timer.c | 205 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 205 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-msm/timer.c
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
new file mode 100644
index 0000000..0781a16
--- /dev/null
+++ b/arch/arm/mach-msm/timer.c
@@ -0,0 +1,205 @@
+/* linux/arch/arm/mach-msm/timer.c
+**
+** Copyright (C) 2007 Google, Inc.
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+*/
+
+#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/clk.h>
+#include <linux/clockchips.h>
+#include <linux/delay.h>
+
+#include <asm/mach/time.h>
+#include <asm/arch/msm_iomap.h>
+
+#include <asm/io.h>
+
+#define MSM_DGT_BASE (MSM_GPT_BASE + 0x10)
+#define MSM_DGT_SHIFT (5)
+
+#define TIMER_MATCH_VAL 0x0000
+#define TIMER_COUNT_VAL 0x0004
+#define TIMER_ENABLE 0x0008
+#define TIMER_ENABLE_CLR_ON_MATCH_EN 2
+#define TIMER_ENABLE_EN 1
+#define TIMER_CLEAR 0x000C
+
+#define CSR_PROTECTION 0x0020
+#define CSR_PROTECTION_EN 1
+
+#define GPT_HZ 32768
+#define DGT_HZ 19200000 // 19.2 MHz or 600 KHz after shift
+
+struct msm_clock {
+ struct clock_event_device clockevent;
+ struct clocksource clocksource;
+ struct irqaction irq;
+ uint32_t regbase;
+ uint32_t freq;
+ uint32_t shift;
+};
+
+static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
+{
+ struct clock_event_device *evt = dev_id;
+ evt->event_handler(evt);
+ return IRQ_HANDLED;
+}
+
+static cycle_t msm_gpt_read(void)
+{
+ return msm_readl(MSM_GPT_BASE + TIMER_COUNT_VAL);
+}
+
+static cycle_t msm_dgt_read(void)
+{
+ return msm_readl(MSM_DGT_BASE + TIMER_COUNT_VAL) >> MSM_DGT_SHIFT;
+}
+
+static int msm_timer_set_next_event(unsigned long cycles,
+ struct clock_event_device *evt)
+{
+ struct msm_clock *clock = container_of(evt, struct msm_clock, clockevent);
+ uint32_t now = msm_readl(clock->regbase + TIMER_COUNT_VAL);
+ uint32_t alarm = now + (cycles << clock->shift);
+ int late;
+
+ msm_writel(alarm, clock->regbase + TIMER_MATCH_VAL);
+ now = msm_readl(clock->regbase + TIMER_COUNT_VAL);
+ late = now - alarm;
+ if(late >= (-2 << clock->shift) && late < DGT_HZ*5) {
+ printk(KERN_NOTICE "msm_timer_set_next_event(%lu) clock %s, "
+ "alarm already expired, now %x, alarm %x, late %d\n",
+ cycles, clock->clockevent.name, now, alarm, late);
+ return -ETIME;
+ }
+ return 0;
+}
+
+static void msm_timer_set_mode(enum clock_event_mode mode,
+ struct clock_event_device *evt)
+{
+ struct msm_clock *clock = container_of(evt, struct msm_clock, clockevent);
+ switch (mode) {
+ case CLOCK_EVT_MODE_RESUME:
+ case CLOCK_EVT_MODE_PERIODIC:
+ break;
+ case CLOCK_EVT_MODE_ONESHOT:
+ msm_writel(TIMER_ENABLE_EN, clock->regbase + TIMER_ENABLE);
+ break;
+ case CLOCK_EVT_MODE_UNUSED:
+ case CLOCK_EVT_MODE_SHUTDOWN:
+ msm_writel(0, clock->regbase + TIMER_ENABLE);
+ break;
+ }
+}
+
+static struct msm_clock msm_clocks[] = {
+ {
+ .clockevent = {
+ .name = "gp_timer",
+ .features = CLOCK_EVT_FEAT_ONESHOT,
+ .shift = 32,
+ .rating = 200,
+ .set_next_event = msm_timer_set_next_event,
+ .set_mode = msm_timer_set_mode,
+ },
+ .clocksource = {
+ .name = "gp_timer",
+ .rating = 200,
+ .read = msm_gpt_read,
+ .mask = CLOCKSOURCE_MASK(32),
+ .shift = 24,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ },
+ .irq = {
+ .name = "gp_timer",
+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_RISING,
+ .handler = msm_timer_interrupt,
+ .dev_id = &msm_clocks[0].clockevent,
+ .irq = INT_GP_TIMER_EXP
+ },
+ .regbase = MSM_GPT_BASE,
+ .freq = GPT_HZ
+ },
+ {
+ .clockevent = {
+ .name = "dg_timer",
+ .features = CLOCK_EVT_FEAT_ONESHOT,
+ .shift = 32 + MSM_DGT_SHIFT,
+ .rating = 300,
+ .set_next_event = msm_timer_set_next_event,
+ .set_mode = msm_timer_set_mode,
+ },
+ .clocksource = {
+ .name = "dg_timer",
+ .rating = 300,
+ .read = msm_dgt_read,
+ .mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)),
+ .shift = 24 - MSM_DGT_SHIFT,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ },
+ .irq = {
+ .name = "dg_timer",
+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_RISING,
+ .handler = msm_timer_interrupt,
+ .dev_id = &msm_clocks[1].clockevent,
+ .irq = INT_DEBUG_TIMER_EXP
+ },
+ .regbase = MSM_DGT_BASE,
+ .freq = DGT_HZ >> MSM_DGT_SHIFT,
+ .shift = MSM_DGT_SHIFT
+ }
+};
+
+static void /*__init*/ msm_timer_init(void)
+{
+ int i;
+ int res;
+ printk("msm_timer_init()\n");
+
+ for(i = 0; i < ARRAY_SIZE(msm_clocks); i++) {
+ struct msm_clock *clock = &msm_clocks[i];
+ struct clock_event_device *ce = &clock->clockevent;
+ struct clocksource *cs = &clock->clocksource;
+ msm_writel(0, clock->regbase + TIMER_ENABLE);
+ msm_writel(0, clock->regbase + TIMER_CLEAR);
+ msm_writel(~0, clock->regbase + TIMER_MATCH_VAL);
+
+ ce->mult = div_sc(clock->freq, NSEC_PER_SEC, ce->shift);
+ // allow at least 10 seconds to notice that the timer wrapped
+ ce->max_delta_ns =
+ clockevent_delta2ns(0xf0000000 >> clock->shift, ce);
+ ce->min_delta_ns = clockevent_delta2ns(4, ce); // 4 gets rounded down to 3
+ ce->cpumask = cpumask_of_cpu(0);
+
+ cs->mult = clocksource_hz2mult(clock->freq,cs->shift);
+ res = clocksource_register(cs);
+ if(res)
+ printk(KERN_ERR "msm_timer_init: clocksource_register "
+ "failed for %s\n", cs->name);
+
+ res = setup_irq(clock->irq.irq, &clock->irq);
+ if(res)
+ printk(KERN_ERR "msm_timer_init: setup_irq "
+ "failed for %s\n", cs->name);
+
+ clockevents_register_device(ce);
+ }
+}
+
+struct sys_timer msm_timer = {
+ .init = msm_timer_init
+};
--
1.5.3.1
[-- Attachment #3: 0mail --]
[-- Type: text/plain, Size: 7874 bytes --]
>From swetland@google.com Fri Nov 9 05:35:00 2007
Return-Path: <swetland@google.com>
Received: from wpck26.suw.corp.google.com [172.24.219.218]
by bulgaria with IMAP (fetchmail-6.3.6)
for <swetland@localhost> (single-drop); Fri, 09 Nov 2007 05:35:00 -0800 (PST)
Received: from wpck26.suw.corp.google.com ([unix socket])
by imap4.corp.google.com (Cyrus v2.2.12-Invoca-RPM-2.2.12-1gg2) with LMTPA;
Fri, 09 Nov 2007 05:35:04 -0800
X-Sieve: CMU Sieve 2.2
Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35])
by wpck26.suw.corp.google.com with ESMTP id lA9DZ4Ou025468
for <swetland@wpck26.suw.corp.google.com>; Fri, 9 Nov 2007 05:35:04 -0800
Received: from bulgaria (bulgaria.corp.google.com [172.18.102.38])
by zps35.corp.google.com with ESMTP id lA9DYufb029971;
Fri, 9 Nov 2007 05:34:56 -0800
Received: by bulgaria (Postfix, from userid 1000)
id 5618E8F45E; Fri, 9 Nov 2007 05:34:46 -0800 (PST)
From: swetland@google.com
To: swetland@google.com
Cc: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>,
Brian Swetland <swetland@android.com>
Subject: [PATCH 3/9] msm: timer support using the GPT and DGT timers
Date: Fri, 9 Nov 2007 05:34:46 -0800
Message-Id: <11946152862759-git-send-email-swetland@frotz.net>
X-Mailer: git-send-email 1.5.3.1
Status: RO
Content-Length: 6551
From: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Brian Swetland <swetland@android.com>
---
arch/arm/mach-msm/timer.c | 205 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 205 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-msm/timer.c
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
new file mode 100644
index 0000000..0781a16
--- /dev/null
+++ b/arch/arm/mach-msm/timer.c
@@ -0,0 +1,205 @@
+/* linux/arch/arm/mach-msm/timer.c
+**
+** Copyright (C) 2007 Google, Inc.
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+*/
+
+#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/clk.h>
+#include <linux/clockchips.h>
+#include <linux/delay.h>
+
+#include <asm/mach/time.h>
+#include <asm/arch/msm_iomap.h>
+
+#include <asm/io.h>
+
+#define MSM_DGT_BASE (MSM_GPT_BASE + 0x10)
+#define MSM_DGT_SHIFT (5)
+
+#define TIMER_MATCH_VAL 0x0000
+#define TIMER_COUNT_VAL 0x0004
+#define TIMER_ENABLE 0x0008
+#define TIMER_ENABLE_CLR_ON_MATCH_EN 2
+#define TIMER_ENABLE_EN 1
+#define TIMER_CLEAR 0x000C
+
+#define CSR_PROTECTION 0x0020
+#define CSR_PROTECTION_EN 1
+
+#define GPT_HZ 32768
+#define DGT_HZ 19200000 // 19.2 MHz or 600 KHz after shift
+
+struct msm_clock {
+ struct clock_event_device clockevent;
+ struct clocksource clocksource;
+ struct irqaction irq;
+ uint32_t regbase;
+ uint32_t freq;
+ uint32_t shift;
+};
+
+static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
+{
+ struct clock_event_device *evt = dev_id;
+ evt->event_handler(evt);
+ return IRQ_HANDLED;
+}
+
+static cycle_t msm_gpt_read(void)
+{
+ return msm_readl(MSM_GPT_BASE + TIMER_COUNT_VAL);
+}
+
+static cycle_t msm_dgt_read(void)
+{
+ return msm_readl(MSM_DGT_BASE + TIMER_COUNT_VAL) >> MSM_DGT_SHIFT;
+}
+
+static int msm_timer_set_next_event(unsigned long cycles,
+ struct clock_event_device *evt)
+{
+ struct msm_clock *clock = container_of(evt, struct msm_clock, clockevent);
+ uint32_t now = msm_readl(clock->regbase + TIMER_COUNT_VAL);
+ uint32_t alarm = now + (cycles << clock->shift);
+ int late;
+
+ msm_writel(alarm, clock->regbase + TIMER_MATCH_VAL);
+ now = msm_readl(clock->regbase + TIMER_COUNT_VAL);
+ late = now - alarm;
+ if(late >= (-2 << clock->shift) && late < DGT_HZ*5) {
+ printk(KERN_NOTICE "msm_timer_set_next_event(%lu) clock %s, "
+ "alarm already expired, now %x, alarm %x, late %d\n",
+ cycles, clock->clockevent.name, now, alarm, late);
+ return -ETIME;
+ }
+ return 0;
+}
+
+static void msm_timer_set_mode(enum clock_event_mode mode,
+ struct clock_event_device *evt)
+{
+ struct msm_clock *clock = container_of(evt, struct msm_clock, clockevent);
+ switch (mode) {
+ case CLOCK_EVT_MODE_RESUME:
+ case CLOCK_EVT_MODE_PERIODIC:
+ break;
+ case CLOCK_EVT_MODE_ONESHOT:
+ msm_writel(TIMER_ENABLE_EN, clock->regbase + TIMER_ENABLE);
+ break;
+ case CLOCK_EVT_MODE_UNUSED:
+ case CLOCK_EVT_MODE_SHUTDOWN:
+ msm_writel(0, clock->regbase + TIMER_ENABLE);
+ break;
+ }
+}
+
+static struct msm_clock msm_clocks[] = {
+ {
+ .clockevent = {
+ .name = "gp_timer",
+ .features = CLOCK_EVT_FEAT_ONESHOT,
+ .shift = 32,
+ .rating = 200,
+ .set_next_event = msm_timer_set_next_event,
+ .set_mode = msm_timer_set_mode,
+ },
+ .clocksource = {
+ .name = "gp_timer",
+ .rating = 200,
+ .read = msm_gpt_read,
+ .mask = CLOCKSOURCE_MASK(32),
+ .shift = 24,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ },
+ .irq = {
+ .name = "gp_timer",
+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_RISING,
+ .handler = msm_timer_interrupt,
+ .dev_id = &msm_clocks[0].clockevent,
+ .irq = INT_GP_TIMER_EXP
+ },
+ .regbase = MSM_GPT_BASE,
+ .freq = GPT_HZ
+ },
+ {
+ .clockevent = {
+ .name = "dg_timer",
+ .features = CLOCK_EVT_FEAT_ONESHOT,
+ .shift = 32 + MSM_DGT_SHIFT,
+ .rating = 300,
+ .set_next_event = msm_timer_set_next_event,
+ .set_mode = msm_timer_set_mode,
+ },
+ .clocksource = {
+ .name = "dg_timer",
+ .rating = 300,
+ .read = msm_dgt_read,
+ .mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)),
+ .shift = 24 - MSM_DGT_SHIFT,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ },
+ .irq = {
+ .name = "dg_timer",
+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_TRIGGER_RISING,
+ .handler = msm_timer_interrupt,
+ .dev_id = &msm_clocks[1].clockevent,
+ .irq = INT_DEBUG_TIMER_EXP
+ },
+ .regbase = MSM_DGT_BASE,
+ .freq = DGT_HZ >> MSM_DGT_SHIFT,
+ .shift = MSM_DGT_SHIFT
+ }
+};
+
+static void /*__init*/ msm_timer_init(void)
+{
+ int i;
+ int res;
+ printk("msm_timer_init()\n");
+
+ for(i = 0; i < ARRAY_SIZE(msm_clocks); i++) {
+ struct msm_clock *clock = &msm_clocks[i];
+ struct clock_event_device *ce = &clock->clockevent;
+ struct clocksource *cs = &clock->clocksource;
+ msm_writel(0, clock->regbase + TIMER_ENABLE);
+ msm_writel(0, clock->regbase + TIMER_CLEAR);
+ msm_writel(~0, clock->regbase + TIMER_MATCH_VAL);
+
+ ce->mult = div_sc(clock->freq, NSEC_PER_SEC, ce->shift);
+ // allow at least 10 seconds to notice that the timer wrapped
+ ce->max_delta_ns =
+ clockevent_delta2ns(0xf0000000 >> clock->shift, ce);
+ ce->min_delta_ns = clockevent_delta2ns(4, ce); // 4 gets rounded down to 3
+ ce->cpumask = cpumask_of_cpu(0);
+
+ cs->mult = clocksource_hz2mult(clock->freq,cs->shift);
+ res = clocksource_register(cs);
+ if(res)
+ printk(KERN_ERR "msm_timer_init: clocksource_register "
+ "failed for %s\n", cs->name);
+
+ res = setup_irq(clock->irq.irq, &clock->irq);
+ if(res)
+ printk(KERN_ERR "msm_timer_init: setup_irq "
+ "failed for %s\n", cs->name);
+
+ clockevents_register_device(ce);
+ }
+}
+
+struct sys_timer msm_timer = {
+ .init = msm_timer_init
+};
--
1.5.3.1
^ permalink raw reply related
* [PATCH] Make builtin-tag.c use parse_options.
From: Carlos Rica @ 2007-11-09 13:42 UTC (permalink / raw)
To: git, Junio C Hamano
Also, this removes those tests ensuring that repeated
-m options don't allocate memory more than once, because now
this is done after parsing options, using the last one
when more are given. The same for -F.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
---
Applied to "next".
Comments welcomed.
builtin-tag.c | 141 ++++++++++++++++++++++++--------------------------------
t/t7004-tag.sh | 8 +---
2 files changed, 61 insertions(+), 88 deletions(-)
diff --git a/builtin-tag.c b/builtin-tag.c
index 66e5a58..5af1950 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -11,9 +11,15 @@
#include "refs.h"
#include "tag.h"
#include "run-command.h"
-
-static const char builtin_tag_usage[] =
- "git-tag [-n [<num>]] -l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg> | -F <file>] <tagname> [<head>]";
+#include "parse-options.h"
+
+static const char * const git_tag_usage[] = {
+ "git-tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]",
+ "git-tag -d <tagname>...",
+ "git-tag [-n [<num>]] -l [<pattern>]",
+ "git-tag -v <tagname>...",
+ NULL
+};
static char signingkey[1000];
@@ -308,101 +314,74 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
{
struct strbuf buf;
unsigned char object[20], prev[20];
- int annotate = 0, sign = 0, force = 0, lines = 0, message = 0;
char ref[PATH_MAX];
const char *object_ref, *tag;
- int i;
struct ref_lock *lock;
+ int annotate = 0, sign = 0, force = 0, lines = 0,
+ delete = 0, verify = 0;
+ char *list = NULL, *msg = NULL, *msgfile = NULL, *keyid = NULL;
+ const char *no_pattern = "NO_PATTERN";
+ struct option options[] = {
+ { OPTION_STRING, 'l', NULL, &list, "pattern", "list tag names",
+ PARSE_OPT_OPTARG, NULL, (intptr_t) no_pattern },
+ { OPTION_INTEGER, 'n', NULL, &lines, NULL,
+ "print n lines of each tag message",
+ PARSE_OPT_OPTARG, NULL, 1 },
+ OPT_BOOLEAN('d', NULL, &delete, "delete tags"),
+ OPT_BOOLEAN('v', NULL, &verify, "verify tags"),
+
+ OPT_GROUP("Tag creation options"),
+ OPT_BOOLEAN('a', NULL, &annotate,
+ "annotated tag, needs a message"),
+ OPT_STRING('m', NULL, &msg, "msg", "message for the tag"),
+ OPT_STRING('F', NULL, &msgfile, "file", "message in a file"),
+ OPT_BOOLEAN('s', NULL, &sign, "annotated and GPG-signed tag"),
+ OPT_STRING('u', NULL, &keyid, "key-id",
+ "use another key to sign the tag"),
+ OPT_BOOLEAN('f', NULL, &force, "replace the tag if exists"),
+ OPT_END()
+ };
+
git_config(git_tag_config);
- strbuf_init(&buf, 0);
- for (i = 1; i < argc; i++) {
- const char *arg = argv[i];
+ argc = parse_options(argc, argv, options, git_tag_usage, 0);
- if (arg[0] != '-')
- break;
- if (!strcmp(arg, "-a")) {
- annotate = 1;
- continue;
- }
- if (!strcmp(arg, "-s")) {
- annotate = 1;
- sign = 1;
- continue;
- }
- if (!strcmp(arg, "-f")) {
- force = 1;
- continue;
- }
- if (!strcmp(arg, "-n")) {
- if (i + 1 == argc || *argv[i + 1] == '-')
- /* no argument */
- lines = 1;
- else
- lines = isdigit(*argv[++i]) ?
- atoi(argv[i]) : 1;
- continue;
- }
- if (!strcmp(arg, "-m")) {
- annotate = 1;
- i++;
- if (i == argc)
- die("option -m needs an argument.");
- if (message)
- die("only one -F or -m option is allowed.");
- strbuf_addstr(&buf, argv[i]);
- message = 1;
- continue;
- }
- if (!strcmp(arg, "-F")) {
- annotate = 1;
- i++;
- if (i == argc)
- die("option -F needs an argument.");
- if (message)
- die("only one -F or -m option is allowed.");
-
- if (!strcmp(argv[i], "-")) {
+ if (list)
+ return list_tags(list == no_pattern ? NULL : list, lines);
+ if (delete)
+ return for_each_tag_name(argv, delete_tag);
+ if (verify)
+ return for_each_tag_name(argv, verify_tag);
+
+ strbuf_init(&buf, 0);
+ if (msg || msgfile) {
+ if (msg && msgfile)
+ die("only one -F or -m option is allowed.");
+ annotate = 1;
+ if (msg)
+ strbuf_addstr(&buf, msg);
+ else {
+ if (!strcmp(msgfile, "-")) {
if (strbuf_read(&buf, 0, 1024) < 0)
- die("cannot read %s", argv[i]);
+ die("cannot read %s", msgfile);
} else {
- if (strbuf_read_file(&buf, argv[i], 1024) < 0)
+ if (strbuf_read_file(&buf, msgfile, 1024) < 0)
die("could not open or read '%s': %s",
- argv[i], strerror(errno));
+ msgfile, strerror(errno));
}
- message = 1;
- continue;
- }
- if (!strcmp(arg, "-u")) {
- annotate = 1;
- sign = 1;
- i++;
- if (i == argc)
- die("option -u needs an argument.");
- if (strlcpy(signingkey, argv[i], sizeof(signingkey))
- >= sizeof(signingkey))
- die("argument to option -u too long");
- continue;
}
- if (!strcmp(arg, "-l"))
- return list_tags(argv[i + 1], lines);
- if (!strcmp(arg, "-d"))
- return for_each_tag_name(argv + i + 1, delete_tag);
- if (!strcmp(arg, "-v"))
- return for_each_tag_name(argv + i + 1, verify_tag);
- usage(builtin_tag_usage);
}
- if (i == argc) {
+ if (argc == 0) {
if (annotate)
- usage(builtin_tag_usage);
+ usage_with_options(git_tag_usage, options);
return list_tags(NULL, lines);
}
- tag = argv[i++];
+ tag = argv[0];
- object_ref = i < argc ? argv[i] : "HEAD";
- if (i + 1 < argc)
+ object_ref = argc == 2 ? argv[1] : "HEAD";
+ if (argc > 2)
die("too many params");
if (get_sha1(object_ref, object))
@@ -419,7 +398,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
die("tag '%s' already exists", tag);
if (annotate)
- create_tag(object, tag, &buf, message, sign, object);
+ create_tag(object, tag, &buf, msg || msgfile, sign, object);
lock = lock_any_ref_for_update(ref, prev, 0);
if (!lock)
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 0d07bc3..4b09d28 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -339,20 +339,14 @@ test_expect_success \
'
test_expect_success \
- 'trying to create tags giving many -m or -F options should fail' '
+ 'trying to create tags giving both -m or -F options should fail' '
echo "message file 1" >msgfile1 &&
echo "message file 2" >msgfile2 &&
! tag_exists msgtag &&
- ! git-tag -m "message 1" -m "message 2" msgtag &&
- ! tag_exists msgtag &&
- ! git-tag -F msgfile1 -F msgfile2 msgtag &&
- ! tag_exists msgtag &&
! git-tag -m "message 1" -F msgfile1 msgtag &&
! tag_exists msgtag &&
! git-tag -F msgfile1 -m "message 1" msgtag &&
! tag_exists msgtag &&
- ! git-tag -F msgfile1 -m "message 1" -F msgfile2 msgtag &&
- ! tag_exists msgtag &&
! git-tag -m "message 1" -F msgfile1 -m "message 2" msgtag &&
! tag_exists msgtag
'
--
1.5.3.4
^ permalink raw reply related
* Re: [PATCH 1/2] Add strchrnul()
From: Jakub Narebski @ 2007-11-09 13:42 UTC (permalink / raw)
To: git
In-Reply-To: <473434ED.50002@op5.se>
[Cc: Andreas Ericsson <ae@op5.se>,
René Scharfe <rene.scharfe@lsrfire.ath.cx>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org]
Andreas Ericsson wrote:
> René Scharfe wrote:
>> As suggested by Pierre Habouzit, add strchrnul(). It's a useful GNU
>> extension and can simplify string parser code. There are several
>> places in git that can be converted to strchrnul(); as a trivial
>> example, this patch introduces its usage to builtin-fetch--tool.c.
>>
>> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
>> ---
>>
>> Makefile | 13 +++++++++++++
>> builtin-fetch--tool.c | 8 ++------
>> compat/strchrnul.c | 8 ++++++++
>> git-compat-util.h | 5 +++++
>> 4 files changed, 28 insertions(+), 6 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 0d5590f..578c999 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -30,6 +30,8 @@ all::
>> #
>> # Define NO_MEMMEM if you don't have memmem.
>> #
>> +# Define NO_STRCHRNUL if you don't have strchrnul.
>> +#
Original patch lacked adding appropriate test to configure,
i.e. something like below to configure.ac
#
# Define NO_STRCHRNUL if you don't have strchrnul.
AC_CHECK_FUNC(strchrnul,
[NO_STRCHRNUL=],
[NO_STRCHRNUL=YesPlease])
AC_SUBST(NO_STRCHRNUL)
and the following line to config.mak.in
NO_STRCHRNUL=@NO_STRCHRNUL@
> This seems overly complicated. How about this instead?
[...]
> I'm fairly much against forcing people to know what library
> functions they have in order to get software to compile
> properly. This is, imo, a neater solution, and also inlines
> the function as suggested by Dscho.
Wouldn't it be better to add ./configure check instead? See above.
Although I guess that people using ./configure to set compilation
options (to generate config.mak.autogen) are minority...
> +#if !defined(__GLIBC__) && !__GLIBC_PREREQ(2, 1)
> +# define strchrnul(s, c) gitstrchrnul(s, c)
> +static inline char *gitstrchrnul(const char *s, int c)
> +{
> + while (*s && *s != c)
> + s++;
> +
> + return (char *)s;
> +}
> +#endif
> +
This is good solution, although I'm not sure about the check itself.
What if somebody has libc which is not glibc, but it does have
strchrnul?
> diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
> index 6a78517..ed60847 100644
> --- a/builtin-fetch--tool.c
> +++ b/builtin-fetch--tool.c
> @@ -435,9 +435,7 @@ static int pick_rref(int sha1_only, const char *rref, const char *ls_remote_resu
> cp++;
> if (!*cp)
> break;
> - np = strchr(cp, '\n');
> - if (!np)
> - np = cp + strlen(cp);
> + np = strchrnul(cp, '\n');
> if (pass) {
> lrr_list[i].line = cp;
> lrr_list[i].name = cp + 41;
> @@ -461,9 +459,7 @@ static int pick_rref(int sha1_only, const char *rref, const char *ls_remote_resu
> rref++;
> if (!*rref)
> break;
> - next = strchr(rref, '\n');
> - if (!next)
> - next = rref + strlen(rref);
> + next = strchrnul(rref, '\n');
> rreflen = next - rref;
>
> for (i = 0; i < lrr_count; i++) {
This IMHO should go to separate patch.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: corrupt object on git-gc
From: Yossi Leybovich @ 2007-11-09 13:38 UTC (permalink / raw)
To: git, ae, Yossi Leybovich
Yossi Leybovich wrote:
>> Hi
>>
>> I know its loose but still I think there are references in the
>> repository to this object.
>> How I can remove it from the repository ?
>>
>That was not a very good idea. You just moved ALL objects whose hash
>begin with 4b out of the object database.
>Try only moving the offending file out of the 4b directory.
Did not help still the repository look for this object?
Any one know how can I track this object and understand which file is it
ib]$ mv .git/objects/4b/9458b3786228369c63936db65827de3cc06200 ../
ib]$ git-fsck --full
dangling commit 0d43a63623237385e432572bf61171713dcd8e98
dangling commit 4fc6b1127e4a7f4ff5b65a2dd8a90779b5aff3e0
dangling commit 7da607374fe2b1ae09228d2035dd608c73dad7c8
dangling commit 004ef09ae022c60a30f9cd61f90d18df5db3628e
dangling commit 85112c6fabb6b8913ab244a8645d67380616eba6
broken link from tree 2d9263c6d23595e7cb2a21e5ebbb53655278dff8
to blob 4b9458b3786228369c63936db65827de3cc06200
missing blob 4b9458b3786228369c63936db65827de3cc06200
dangling commit bd98481afa93356fa6daa4b6f88c4e631ae2fd72
dangling commit e81e3d2c9c25e5bf5b31327b10b23f9bd0a6d056
dangling commit 92ff9b8cbc771345c9cde0c7fef2c23bb79242b9
^ permalink raw reply
* Re: [BUG] git-rebase fails when a commit message contains a diff
From: Johannes Schindelin @ 2007-11-09 13:20 UTC (permalink / raw)
To: Benoit Sigoure; +Cc: Junio C Hamano, Jonas Fonseca, git
In-Reply-To: <6FCE17E3-9FAA-4676-B12A-369B31743DA6@lrde.epita.fr>
Hi,
On Fri, 9 Nov 2007, Benoit Sigoure wrote:
> On Nov 9, 2007, at 3:28 AM, Johannes Schindelin wrote:
>
> > Would that not be easier to read as
> >
> > test t = "$INTERACTIVE" &&
> > git_editor "$TODO" || die "Could not execute editor"
>
> Hmm this will `die' if you're not running interactively.
D'oh. Of course I meant
test -z "$INTERACTIVE" || git_editor "$TODO" || die ...
Ciao,
Dscho
^ permalink raw reply
* Re: cogito remote branch
From: Andreas Ericsson @ 2007-11-09 13:20 UTC (permalink / raw)
To: MichaelTiloDressel@t-online.de; +Cc: git
In-Reply-To: <1IqTj5-24rt3I0@fwd33.aul.t-online.de>
MichaelTiloDressel@t-online.de wrote:
> Hi,
>
> I just saw the scripts cg-update, cg-push .. scripts try to guess a
> branch name functioning as origin if no argument is given. These scripts
> seam to use a branch named <branchname>-origin if it exists and the
> current
> branch is named <branchname> and is not the branch named master.
>
> I like that feature. Is it anywhere documented?
>
> In case there is no branch named <branchname>-origin the scripts just
> use origin even if the current branch is not master. I would prefer the
> scripts to fail in this case and to print a message asking the user to
> specifically name a branch.
>
Cogito is deprecated, and has been for quite some time. The "remote"
feature of core git (inspired by cogito) offers similar benefits.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* cogito remote branch
From: MichaelTiloDressel @ 2007-11-09 13:16 UTC (permalink / raw)
To: git
Hi,
I just saw the scripts cg-update, cg-push .. scripts try to guess a
branch name functioning as origin if no argument is given. These scripts
seam to use a branch named <branchname>-origin if it exists and the
current
branch is named <branchname> and is not the branch named master.
I like that feature. Is it anywhere documented?
In case there is no branch named <branchname>-origin the scripts just
use origin even if the current branch is not master. I would prefer the
scripts to fail in this case and to print a message asking the user to
specifically name a branch.
Cheers,
Michael
^ permalink raw reply
* Re: corrupt object on git-gc
From: Andreas Ericsson @ 2007-11-09 12:56 UTC (permalink / raw)
To: Yossi Leybovich; +Cc: Alex Riesen, git
In-Reply-To: <6C2C79E72C305246B504CBA17B5500C9029A36F2@mtlexch01.mtl.com>
Yossi Leybovich wrote:
> Hi
>
> I know its loose but still I think there are references in the
> repository to this object.
> How I can remove it from the repository ?
>
>
> sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib
> $ mv .git/objects/4b ..
>
That was not a very good idea. You just moved ALL objects whose hash
begin with 4b out of the object database.
Try only moving the offending file out of the 4b directory.
> sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib
> $ git-fsck --full
> to blob 4b920d658a05a66a9d18dd34b51d6e3a9f229ce1
> to commit 4b1aabfe3ecc12007535369a2ba17bcee776df64
> to blob 4b920d658a05a66a9d18dd34b51d6e3a9f229ce1
> to tree 4b89da873ce6e1b36a818d70d4665b3074f2354c
> to blob 4b920d658a05a66a9d18dd34b51d6e3a9f229ce1>
Notice how all of these start with 4b? Move the directory back and
get rid of just the object that causes errors.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* tracking remotes with Git
From: Ivan Shmakov @ 2007-11-09 12:44 UTC (permalink / raw)
To: git
I'm using Git (1.5.3.5 debian 1) for about a day or so, and I'm
quite impressed that it allows tracking remote repositories
(I've tried CVS and SVN) so easily with `git-cvsimport' and
`git-svn'. However, I've ran into a couple of problems with
them:
* it looks like `git-cvsimport' uses its own CVS protocol
implementation which doesn't support compression; I've tried
to clone a repository of a project hosted in CVS since circa
1998 and it 20 MiB or so to obtain revisions until 2000 or so;
any ways to minimize traffic?
* how many revisions will `git-svn fetch' obtain from the SVN
repository? I had to run it for several times to get the full
history; I've tried to use (undocumented) `--fetch-all'
option, but it appears to help (may be but for a little.)
BTW, does http://.../git.git/ mean a ``bare repository (i. e., a
would be /git/.git/) for Git''?
PS. I wonder, if this mailing list accepts mail from unsubscribed
`From:'s?
^ permalink raw reply
* RE: corrupt object on git-gc
From: Yossi Leybovich @ 2007-11-09 12:23 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
In-Reply-To: <20071109081035.GA2794@steel.home>
Hi
I know its loose but still I think there are references in the
repository to this object.
How I can remove it from the repository ?
sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib
$ mv .git/objects/4b ..
sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib
$ git-fsck --full
broken link from tree ca8022a21a064d075d71a342744e584024fd2782
to blob 4b920d658a05a66a9d18dd34b51d6e3a9f229ce1
broken link from commit 2ca27acf05f1631586718b68ce43f0a0400e1f9b
to commit 4b1aabfe3ecc12007535369a2ba17bcee776df64
dangling commit 0d43a63623237385e432572bf61171713dcd8e98
dangling tree b303c073c5d6c30de761a5ecce39ab30da81e98a
dangling tree f3c333f9756e824e6b51e585d734e410790e7dc5
dangling tree 10a4688d94ab6b1fb1bb3aee7e77255a0e41ae94
broken link from tree eea47bf0788a38ac0988de26eddafa8d60caaa58
to blob 4b920d658a05a66a9d18dd34b51d6e3a9f229ce1
broken link from commit 06858a6c8d5a6b1ffbc203057d023c48567dd83e
to tree 4b89da873ce6e1b36a818d70d4665b3074f2354c
dangling commit 4fc6b1127e4a7f4ff5b65a2dd8a90779b5aff3e0
dangling commit 7da607374fe2b1ae09228d2035dd608c73dad7c8
missing tree 4b89da873ce6e1b36a818d70d4665b3074f2354c
broken link from tree 380b2b78d10136cc2b6e1578f4906fccb3e432b1
to blob 4b920d658a05a66a9d18dd34b51d6e3a9f229ce1>
-----Original Message-----
Thanks
Yossi
> From: Alex Riesen [mailto:raa.lkml@gmail.com]
> Sent: Friday, November 09, 2007 3:11 AM
> To: Yossi Leybovich
> Cc: git@vger.kernel.org
> Subject: Re: corrupt object on git-gc
>
> Yossi Leybovich, Fri, Nov 09, 2007 00:59:47 +0100:
> > I wonder if someone can help in this error
> > I tried to do git-gc and got error on corrupted object.
> >
> > I do the following:
> >
> > $ git-gc
> > Generating pack...
> > Done counting 3037 objects.
> > Deltifying 3037 objects...
> > error: corrupt loose object
> '4b9458b3786228369c63936db65827de3cc06200'
>
> It is loose. Nothing uses it in this repository. What do you need to
> repair it for?
>
> > fatal: object 4b9458b3786228369c63936db65827de3cc06200 cannot be
read
> > error: failed to run repack
> >
> > sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib
> > $ cd .git/objects/4b/
> >
> > sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib/.git/objects/4b
> > $ git-fsck-objects.exe 9458b3786228369c63936db65827de3cc06200
> > error: corrupt loose object
> '4b9458b3786228369c63936db65827de3cc06200'
> > error: 4b9458b3786228369c63936db65827de3cc06200: object corrupt or
> > missing
> > error: invalid parameter: expected sha1, got
> > '9458b3786228369c63936db65827de3cc06200'
> > missing blob 4b9458b3786228369c63936db65827de3cc06200
>
> the directories directly under .git/objects contain the first bytes of
> sha1, to use filesystem in a more efficient way. git-fsck expects an
> sha1 (or a reference).
>
> Try running moving the corrupt object (with its *whole* name) some
> place else and run git-fsck --all.
^ permalink raw reply
* RE: corrupt object on git-gc
From: Yossi Leybovich @ 2007-11-09 12:16 UTC (permalink / raw)
To: Christian Couder; +Cc: git
In-Reply-To: <200711090613.17566.chriscool@tuxfamily.org>
Just tried it :
sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib
$ git-cat-file.exe -p 4b9458b3786228369c63936db65827de3cc06200
error: corrupt loose object '4b9458b3786228369c63936db65827de3cc06200'
fatal: Cannot read object 4b9458b3786228369c63936db65827de3cc06200
Is this say something ?
Yossi
> -----Original Message-----
> From: Christian Couder [mailto:chriscool@tuxfamily.org]
> Sent: Friday, November 09, 2007 12:13 AM
> To: Yossi Leybovich
> Cc: git@vger.kernel.org
> Subject: Re: corrupt object on git-gc
>
> Le vendredi 9 novembre 2007, Yossi Leybovich a écrit :
> >
> > Unfortunately I can't get this object from backup directories as
> advise
> > in the FAQ.
> > Can this object manually fixed by any tool? (the object is attached)
> I
> > don't even know to which file/tree/commit it belong how can I know
> that
> > ?
>
> Could you try something like:
>
> git-cat-file -p 4b9458b3786228369c63936db65827de3cc06200
>
> in your repository ?
>
> Thanks,
> Christian.
^ permalink raw reply
* [PATCH] gitk: Use a different background color for the active head.
From: Marco Colombo @ 2007-11-09 11:21 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: 0001-gitk-Use-a-different-background-color-for-the-activ.patch --]
[-- Type: text/x-patch, Size: 890 bytes --]
>From 7c7a8f6dbe5c4f96ddbc508fa4ab9c2dbae56d82 Mon Sep 17 00:00:00 2001
From: Marco Colombo <m.colombo@ed.ac.uk>
Date: Fri, 9 Nov 2007 10:19:01 +0000
Subject: [PATCH] gitk: Use a different background color for the active head.
Currently the background color of all heads is green. The active head is
distinguished only by the use of a bold font. This patch changes the
background color of the active head to orange, thus making it
visually more separate from the other heads.
Signed-off-by: Marco Colombo <m.colombo@ed.ac.uk>
---
gitk | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 1da0b0a..dacbc31 100755
--- a/gitk
+++ b/gitk
@@ -4038,6 +4038,7 @@ proc drawtags {id x xt y1} {
if {[incr nheads -1] >= 0} {
set col green
if {$tag eq $mainhead} {
+ set col orange
set font mainfontbold
}
} else {
--
1.5.3.4
^ permalink raw reply related
* [PATCH] builtin-blame: set up the work_tree before the first file access
From: Johannes Schindelin @ 2007-11-09 11:34 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Junio C Hamano, git
In-Reply-To: <20071104070307.GA26071@laptop>
We check in cmd_blame() if the specified path is there, but we
failed to set up the working tree before that.
While at it, make setup_work_tree() just return if it was run
before.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
IMO both this patch and the recent patch to call setup_work_tree()
are needed. Only the second call to setup_work_tree() will know
if there was no revision specified, and the first one will know if
a -- has been seen.
builtin-blame.c | 1 +
setup.c | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index 55a3c0b..ba80bf8 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2295,6 +2295,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
else if (i != argc - 1)
usage(blame_usage); /* garbage at end */
+ setup_work_tree();
if (!has_path_in_work_tree(path))
die("cannot stat path %s: %s",
path, strerror(errno));
diff --git a/setup.c b/setup.c
index 084d722..1421a2c 100644
--- a/setup.c
+++ b/setup.c
@@ -207,12 +207,18 @@ static const char *set_work_tree(const char *dir)
}
void setup_work_tree(void) {
- const char *work_tree = get_git_work_tree();
- const char *git_dir = get_git_dir();
+ const char *work_tree, *git_dir;
+ static int initialized = 0;
+
+ if (initialized)
+ return;
+ work_tree = get_git_work_tree();
+ git_dir = get_git_dir();
if (!is_absolute_path(git_dir))
set_git_dir(make_absolute_path(git_dir));
if (!work_tree || chdir(work_tree))
die("This operation must be run in a work tree");
+ initialized = 1;
}
/*
--
1.5.3.5.1645.g1f4df
^ permalink raw reply related
* Re: [PATCH] Add missing inside_work_tree setting in setup_git_directory_gently
From: Johannes Schindelin @ 2007-11-09 11:32 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Junio C Hamano, git
In-Reply-To: <20071104070307.GA26071@laptop>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2323 bytes --]
Hi,
On Sun, 4 Nov 2007, Nguyen Thai Ngoc Duy wrote:
> On Sat, Nov 03, 2007 at 09:33:40PM -0700, Junio C Hamano wrote:
> > Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> >
> > > When both GIT_DIR and GIT_WORK_TREE are set, and
> > > setup_git_directory_gently() changes the current working
> > > directory accordingly, it should also set inside_work_tree = 1.
> > >
> > > Without this, work_tree handling code in setup_git_directory()
> > > will be activated. If you stay in root work tree (no prefix),
> > > it does not harm. It does if you work from a subdirectory though.
> >
> > Please add automated test script for this, thanks.
> >
>
> Thank you for reminding. I tried to put a test in
> t1501-worktree.sh and found out core.worktree can override
> inside_work_tree previously set by setup_git_directory_gently(),
> activating the worktree code in setup_git_directory() again.
>
> This made me think setup_git_directory_gently() should use
> get_git_work_tree() instead. But then git_work_tree_cfg may not be
> initialized when get_git_work_tree() is called (starting from
> setup_git_directory(), git_work_tree_cfg is initialized in
> check_repository_format_version(), which is called _after_
> setup_git_directory_gently()).
>
> The interaction between these variables and functions is really beyond
> my knowledge. Johannes, can you have a look at this? In theory the
> following test should pass:
>
> diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
> index 7ee3820..bdb7720 100755
> --- a/t/t1501-worktree.sh
> +++ b/t/t1501-worktree.sh
> @@ -103,6 +103,11 @@ test_expect_success 'repo finds its work tree from work tree, too' '
> test sub/dir/tracked = "$(git ls-files)")
> '
>
> +test_expect_success 'Try a command from subdir in worktree' '
> + (cd repo.git/work/sub &&
> + GIT_DIR=../.. GIT_WORK_TREE=.. git blame dir/tracked)
> +'
> +
> test_expect_success '_gently() groks relative GIT_DIR & GIT_WORK_TREE' '
> cd repo.git/work/sub/dir &&
> GIT_DIR=../../.. GIT_WORK_TREE=../.. GIT_PAGER= \
This does not really test work_tree, but if blame uses the work_tree
machinery correctly.
I will send out a patch to builtin-blame.c in a minute.
However, this test case still fails, since blame needs a HEAD revision!
And in t1501 there is no commit done yet.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH 07/11] git-fetch: Limit automated tag following to only fetched objects
From: Johannes Sixt @ 2007-11-09 11:28 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Junio C Hamano, git
In-Reply-To: <20071109110631.GG19368@spearce.org>
Shawn O. Pearce schrieb:
> Some of the test vectors for t5515 were affected by this as they
> were listing "not-for-merge" tags in .git/FETCH_HEAD that were
> being fetched under the old rule but are now not fetched under the
> new rule. To be perfectly honest I have no idea why they were even
> fetching under the old rule, and I think that's part of the problem
> with the old rule. It was very difficult to understand why some
> things would auto-follow a tag and others wouldn't.
The old rule was:
Fetch a tag if we have the object that the tag refers to.
So, If you have an object lingering in your repo, even if it is not
accessible by any of the refs - eg. it's a left-over from a previous fetch -
then the tag was fetched again.
-- Hannes
^ permalink raw reply
* [PATCH 11/11] git-fetch: test avoiding unnecessary copying from alternates
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This test verifies my prior "avoid local fetching from alternate"
patch is functional and doesn't regress in the future during any
additional improvements made to git.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
t/t5502-quickfetch.sh | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh
index b4760f2..16eadd6 100755
--- a/t/t5502-quickfetch.sh
+++ b/t/t5502-quickfetch.sh
@@ -86,4 +86,37 @@ test_expect_success 'quickfetch should not leave a corrupted repository' '
'
+test_expect_success 'quickfetch should not copy from alternate' '
+
+ (
+ mkdir quickclone &&
+ cd quickclone &&
+ git init-db &&
+ (cd ../.git/objects && pwd) >.git/objects/info/alternates &&
+ git remote add origin .. &&
+ git fetch -k -k
+ ) &&
+ obj_cnt=$( (
+ cd quickclone &&
+ git count-objects | sed -e "s/ *objects,.*//"
+ ) ) &&
+ pck_cnt=$( (
+ cd quickclone &&
+ git count-objects -v | sed -n -e "/packs:/{
+ s/packs://
+ p
+ q
+ }"
+ ) ) &&
+ origin_master=$( (
+ cd quickclone &&
+ git rev-parse origin/master
+ ) ) &&
+ echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
+ test $obj_cnt -eq 0 &&
+ test $pck_cnt -eq 0 &&
+ test z$origin_master = z$(git rev-parse master)
+
+'
+
test_done
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
* [PATCH 10/11] git-fetch: avoid local fetching from alternate (again)
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Back in e3c6f240fd9c5bdeb33f2d47adc859f37935e2df Junio taught
git-fetch to avoid copying objects when we are fetching from
a repository that is already registered as an alternate object
database. In such a case there is no reason to copy any objects
as we can already obtain them through the alternate.
However we need to ensure the objects are all reachable, so we
run `git rev-list --objects $theirs --not --all` to verify this.
If any object is missing or unreadable then we need to fetch/copy
the objects from the remote. When a missing object is detected
the git-rev-list process will exit with a non-zero exit status,
making this condition quite easy to detect.
Although git-fetch is currently a builtin (and so is rev-list)
we cannot invoke the traverse_objects() API at this point in the
transport code. The object walker within traverse_objects() calls
die() as soon as it finds an object it cannot read. If that happens
we want to resume the fetch process by calling do_fetch_pack().
To get aroaund this we spawn git-rev-list into a background process
to prevent a die() from killing the foreground fetch process,
thus allowing the fetch process to resume into do_fetch_pack()
if copying is necessary.
We aren't interested in the output of rev-list (a list of SHA-1
object names that are reachable) or its errors (a "spurious" error
about an object not being found as we need to copy it) so we redirect
both stdout and stderr to /dev/null.
We run this git-rev-list based check before any fetch as we may
already have the necessary objects local from a prior fetch. If we
don't then its very likely the first $theirs object listed on the
command line won't exist locally and git-rev-list will die very
quickly, allowing us to start the network transfer. This test even
on remote URLs may save bandwidth if someone runs `git pull origin`,
sees a merge conflict, resets out, then redoes the same pull just
a short time later. If the remote hasn't changed between the two
pulls and the local repository hasn't had git-gc run in it then
there is probably no need to perform network transfer as all of
the objects are local.
Documentation for the new fetch_local_nocopy function was suggested
and written by Junio, based on his original comment in git-fetch.sh.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
transport.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 65 insertions(+), 3 deletions(-)
diff --git a/transport.c b/transport.c
index f4577b7..883348b 100644
--- a/transport.c
+++ b/transport.c
@@ -615,17 +615,76 @@ static struct ref *get_refs_via_connect(struct transport *transport)
return refs;
}
+/*
+ * We would want to bypass the object transfer altogether if
+ * everything we are going to fetch already exists and connected
+ * locally.
+ *
+ * The refs we are going to fetch are in to_fetch (nr_heads in
+ * total). If running
+ *
+ * $ git-rev-list --objects to_fetch[0] to_fetch[1] ... --not --all
+ *
+ * does not error out, that means everything reachable from the
+ * refs we are going to fetch exists and is connected to some of
+ * our existing refs.
+ */
+static int fetch_local_nocopy(struct transport *transport,
+ int nr_heads, struct ref **to_fetch)
+{
+ struct git_transport_data *data = transport->data;
+ struct child_process revlist;
+ char **argv;
+ int i, j, err;
+
+ /*
+ * If we are deepening a shallow clone we already have these
+ * objects reachable. Running rev-list here will return with
+ * a good (0) exit status and we'll bypass the fetch that we
+ * really need to perform. Claiming failure now will ensure
+ * we perform the network exchange to deepen our history.
+ */
+ if (data->depth)
+ return -1;
+
+ i = 0;
+ argv = xmalloc(sizeof(*argv) * (nr_heads + 6));
+ argv[i++] = xstrdup("rev-list");
+ argv[i++] = xstrdup("--quiet");
+ argv[i++] = xstrdup("--objects");
+ for (j = 0; j < nr_heads; j++)
+ argv[i++] = xstrdup(sha1_to_hex(to_fetch[j]->old_sha1));
+ argv[i++] = xstrdup("--not");
+ argv[i++] = xstrdup("--all");
+ argv[i++] = NULL;
+
+ memset(&revlist, 0, sizeof(revlist));
+ revlist.argv = (const char**)argv;
+ revlist.git_cmd = 1;
+ revlist.no_stdin = 1;
+ revlist.no_stdout = 1;
+ revlist.no_stderr = 1;
+ err = run_command(&revlist);
+
+ for (i = 0; argv[i]; i++)
+ free(argv[i]);
+ free(argv);
+ return err;
+}
+
static int fetch_refs_via_pack(struct transport *transport,
int nr_heads, struct ref **to_fetch)
{
struct git_transport_data *data = transport->data;
- char **heads = xmalloc(nr_heads * sizeof(*heads));
- char **origh = xmalloc(nr_heads * sizeof(*origh));
+ char **heads, **origh;
struct ref *refs;
- char *dest = xstrdup(transport->url);
+ char *dest;
struct fetch_pack_args args;
int i;
+ if (!fetch_local_nocopy(transport, nr_heads, to_fetch))
+ return 0;
+
memset(&args, 0, sizeof(args));
args.uploadpack = data->uploadpack;
args.keep_pack = data->keep;
@@ -634,6 +693,9 @@ static int fetch_refs_via_pack(struct transport *transport,
args.verbose = transport->verbose > 0;
args.depth = data->depth;
+ heads = xmalloc(nr_heads * sizeof(*heads));
+ origh = xmalloc(nr_heads * sizeof(*origh));
+ dest = xstrdup(transport->url);
for (i = 0; i < nr_heads; i++)
origh[i] = heads[i] = xstrdup(to_fetch[i]->name);
refs = fetch_pack(&args, dest, nr_heads, heads, &transport->pack_lockfile);
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
* [PATCH 09/11] rev-list: Introduce --quiet to avoid /dev/null redirects
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Some uses of git-rev-list are to run it with --objects to see if
a range of objects between two or more commits is fully connected
or not. In such a case the caller doesn't care about the actual
object names or hash hints so formatting this data only for it to
be dumped to /dev/null by a redirect is a waste of CPU time. If
all the caller needs is the exit status then --quiet can be used
to bypass the commit and object formatting.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
Documentation/git-rev-list.txt | 9 +++++++++
builtin-rev-list.c | 26 ++++++++++++++++++++++----
2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 4852804..989fbf3 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -20,6 +20,7 @@ SYNOPSIS
[ \--not ]
[ \--all ]
[ \--stdin ]
+ [ \--quiet ]
[ \--topo-order ]
[ \--parents ]
[ \--timestamp ]
@@ -270,6 +271,14 @@ limiting may be applied.
In addition to the '<commit>' listed on the command
line, read them from the standard input.
+--quiet::
+
+ Don't print anything to standard output. This form of
+ git-rev-list is primarly meant to allow the caller to
+ test the exit status to see if a range of objects is fully
+ connected (or not). It is faster than redirecting stdout
+ to /dev/null as the output does not have to be formatted.
+
--cherry-pick::
Omit any commit that introduces the same change as
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 2dec887..d67724c 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -26,6 +26,7 @@ static const char rev_list_usage[] =
" --remove-empty\n"
" --all\n"
" --stdin\n"
+" --quiet\n"
" ordering output:\n"
" --topo-order\n"
" --date-order\n"
@@ -50,6 +51,7 @@ static int show_timestamp;
static int hdr_termination;
static const char *header_prefix;
+static void finish_commit(struct commit *commit);
static void show_commit(struct commit *commit)
{
if (show_timestamp)
@@ -93,6 +95,11 @@ static void show_commit(struct commit *commit)
strbuf_release(&buf);
}
maybe_flush_or_die(stdout, "stdout");
+ finish_commit(commit);
+}
+
+static void finish_commit(struct commit *commit)
+{
if (commit->parents) {
free_commit_list(commit->parents);
commit->parents = NULL;
@@ -101,6 +108,12 @@ static void show_commit(struct commit *commit)
commit->buffer = NULL;
}
+static void finish_object(struct object_array_entry *p)
+{
+ if (p->item->type == OBJ_BLOB && !has_sha1_file(p->item->sha1))
+ die("missing blob object '%s'", sha1_to_hex(p->item->sha1));
+}
+
static void show_object(struct object_array_entry *p)
{
/* An object with name "foo\n0000000..." can be used to
@@ -108,9 +121,7 @@ static void show_object(struct object_array_entry *p)
*/
const char *ep = strchr(p->name, '\n');
- if (p->item->type == OBJ_BLOB && !has_sha1_file(p->item->sha1))
- die("missing blob object '%s'", sha1_to_hex(p->item->sha1));
-
+ finish_object(p);
if (ep) {
printf("%s %.*s\n", sha1_to_hex(p->item->sha1),
(int) (ep - p->name),
@@ -527,6 +538,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
int read_from_stdin = 0;
int bisect_show_vars = 0;
int bisect_find_all = 0;
+ int quiet = 0;
git_config(git_default_config);
init_revisions(&revs, prefix);
@@ -565,6 +577,10 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
read_revisions_from_stdin(&revs);
continue;
}
+ if (!strcmp(arg, "--quiet")) {
+ quiet = 1;
+ continue;
+ }
usage(rev_list_usage);
}
@@ -640,7 +656,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
}
}
- traverse_commit_list(&revs, show_commit, show_object);
+ traverse_commit_list(&revs,
+ quiet ? finish_commit : show_commit,
+ quiet ? finish_object : show_object);
return 0;
}
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
* [PATCH 08/11] run-command: Support sending stderr to /dev/null
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Some callers may wish to redirect stderr to /dev/null in some
contexts, such as if they are executing a command only to get
the exit status and don't want users to see whatever output it
may produce as a side-effect of computing that exit status.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
run-command.c | 6 ++++--
run-command.h | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/run-command.c b/run-command.c
index d99a6c4..476d00c 100644
--- a/run-command.c
+++ b/run-command.c
@@ -41,7 +41,7 @@ int start_command(struct child_process *cmd)
cmd->close_out = 1;
}
- need_err = cmd->err < 0;
+ need_err = !cmd->no_stderr && cmd->err < 0;
if (need_err) {
if (pipe(fderr) < 0) {
if (need_in)
@@ -87,7 +87,9 @@ int start_command(struct child_process *cmd)
close(cmd->out);
}
- if (need_err) {
+ if (cmd->no_stderr)
+ dup_devnull(2);
+ else if (need_err) {
dup2(fderr[1], 2);
close_pair(fderr);
}
diff --git a/run-command.h b/run-command.h
index 94e1e9d..1fc781d 100644
--- a/run-command.h
+++ b/run-command.h
@@ -23,6 +23,7 @@ struct child_process {
unsigned close_out:1;
unsigned no_stdin:1;
unsigned no_stdout:1;
+ unsigned no_stderr:1;
unsigned git_cmd:1; /* if this is to be git sub-command */
unsigned stdout_to_stderr:1;
};
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
* [PATCH 07/11] git-fetch: Limit automated tag following to only fetched objects
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
When we fetch objects with any transport we want to follow (fetch)
any tag that refers to an object we just transferred, if automated
tag fetching is enabled.
In the past this rule was based on any object that was supposedly
reachable by the local repository. However this depended heavily
on the transport implementation actually using the object walking
system to lookup all reachable objects. In the case of both the
native git protocol and the HTTP walker not all objects get looked
up; instead only those that are necessary to determine what to fetch
are processed. This can cause random behavior for tags where some
are fetched and some aren't.
We now redefine the rule to be: "tags are fetched if they refer
to an object that was just transferred; that is an object that is
new to your repository". This rule is quite simple to understand,
you only get a tag if you just got the object it refers to.
Some of the test vectors for t5515 were affected by this as they
were listing "not-for-merge" tags in .git/FETCH_HEAD that were
being fetched under the old rule but are now not fetched under the
new rule. To be perfectly honest I have no idea why they were even
fetching under the old rule, and I think that's part of the problem
with the old rule. It was very difficult to understand why some
things would auto-follow a tag and others wouldn't.
As a bonus side-effect of this change git-fetch will fail early
without updating any refs if a bogus server gave us a packfile
that doesn't contain all of the objects we need to make a fully
reachable ref. This could happen due to a bug on the remote side,
where the set of objects to be packed was miscalculated and a valid
packfile was sent but one or more objects are missing from it.
It has probably never happened in practice but its better to be
paranoid in what we accept over the wire then to blindly trust the
other peer.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
builtin-fetch.c | 41 +++++++++++++++++++-
t/t5515/fetch.br-branches-default | 2 -
t/t5515/fetch.br-branches-default-merge | 2 -
...etch.br-branches-default-merge_branches-default | 2 -
t/t5515/fetch.br-branches-default-octopus | 2 -
...ch.br-branches-default-octopus_branches-default | 2 -
t/t5515/fetch.br-branches-default_branches-default | 2 -
t/t5515/fetch.br-branches-one | 2 -
t/t5515/fetch.br-branches-one-merge | 2 -
t/t5515/fetch.br-branches-one-merge_branches-one | 2 -
t/t5515/fetch.br-branches-one-octopus | 2 -
t/t5515/fetch.br-branches-one-octopus_branches-one | 2 -
t/t5515/fetch.br-branches-one_branches-one | 2 -
t/t5515/fetch.br-config-explicit | 2 -
t/t5515/fetch.br-config-explicit-merge | 2 -
.../fetch.br-config-explicit-merge_config-explicit | 2 -
t/t5515/fetch.br-config-explicit-octopus | 2 -
...etch.br-config-explicit-octopus_config-explicit | 2 -
t/t5515/fetch.br-config-explicit_config-explicit | 2 -
t/t5515/fetch.br-config-glob | 2 -
t/t5515/fetch.br-config-glob-merge | 2 -
t/t5515/fetch.br-config-glob-merge_config-glob | 2 -
t/t5515/fetch.br-config-glob-octopus | 2 -
t/t5515/fetch.br-config-glob-octopus_config-glob | 2 -
t/t5515/fetch.br-config-glob_config-glob | 2 -
t/t5515/fetch.br-remote-explicit | 2 -
t/t5515/fetch.br-remote-explicit-merge | 2 -
.../fetch.br-remote-explicit-merge_remote-explicit | 2 -
t/t5515/fetch.br-remote-explicit-octopus | 2 -
...etch.br-remote-explicit-octopus_remote-explicit | 2 -
t/t5515/fetch.br-remote-explicit_remote-explicit | 2 -
t/t5515/fetch.br-remote-glob | 2 -
t/t5515/fetch.br-remote-glob-merge | 2 -
t/t5515/fetch.br-remote-glob-merge_remote-glob | 2 -
t/t5515/fetch.br-remote-glob-octopus | 2 -
t/t5515/fetch.br-remote-glob-octopus_remote-glob | 2 -
t/t5515/fetch.br-remote-glob_remote-glob | 2 -
t/t5515/fetch.br-unconfig | 2 -
...nfig_.._.git_one_tag_tag-one_tag_tag-three-file | 1 -
...h.br-unconfig_.._.git_tag_tag-one_tag_tag-three | 2 -
t/t5515/fetch.br-unconfig_branches-default | 2 -
t/t5515/fetch.br-unconfig_branches-one | 2 -
t/t5515/fetch.br-unconfig_config-explicit | 2 -
t/t5515/fetch.br-unconfig_config-glob | 2 -
t/t5515/fetch.br-unconfig_remote-explicit | 2 -
t/t5515/fetch.br-unconfig_remote-glob | 2 -
t/t5515/fetch.master | 2 -
...ster_.._.git_one_tag_tag-one_tag_tag-three-file | 1 -
.../fetch.master_.._.git_tag_tag-one_tag_tag-three | 2 -
t/t5515/fetch.master_branches-default | 2 -
t/t5515/fetch.master_branches-one | 2 -
t/t5515/fetch.master_config-explicit | 2 -
t/t5515/fetch.master_config-glob | 2 -
t/t5515/fetch.master_remote-explicit | 2 -
t/t5515/fetch.master_remote-glob | 2 -
55 files changed, 39 insertions(+), 108 deletions(-)
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 18f123e..6a36c02 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -8,6 +8,9 @@
#include "path-list.h"
#include "remote.h"
#include "transport.h"
+#include "diff.h"
+#include "list-objects.h"
+#include "revision.h"
static const char fetch_usage[] = "git-fetch [-a | --append] [--upload-pack <upload-pack>] [-f | --force] [--no-tags] [-t | --tags] [-k | --keep] [-u | --update-head-ok] [--depth <depth>] [-v | --verbose] [<repository> <refspec>...]";
@@ -335,14 +338,46 @@ static void store_updated_refs(const char *url, struct ref *ref_map)
fclose(fp);
}
+static void mark_just_fetched_commit(struct commit *commit)
+{
+}
+
+static void mark_just_fetched_object(struct object_array_entry *p)
+{
+ if (p->item->type == OBJ_BLOB && !has_sha1_file(p->item->sha1))
+ die("missing blob object '%s'", sha1_to_hex(p->item->sha1));
+}
+
static int fetch_refs(struct transport *transport, struct ref *ref_map)
{
int ret;
free_all_objects();
ret = transport_fetch_refs(transport, ref_map);
- if (!ret)
+ if (!ret) {
+ const char *args[] = { "rev-list", "--objects", "--not", "--all", NULL};
+ struct rev_info revs;
+ struct ref *ref;
+
+ free_all_objects();
+ init_revisions(&revs, NULL);
+ setup_revisions(ARRAY_SIZE(args) - 1, args, &revs, NULL);
+ save_commit_buffer = 0;
+ track_object_refs = 0;
+
+ for (ref = ref_map; ref; ref = ref->next) {
+ struct object *o = parse_object(ref->old_sha1);
+ if (o)
+ add_pending_object(&revs, o, "(just-fetched)");
+ }
+
+ prepare_revision_walk(&revs);
+ mark_edges_uninteresting(revs.commits, &revs, NULL);
+ traverse_commit_list(&revs,
+ mark_just_fetched_commit,
+ mark_just_fetched_object);
store_updated_refs(transport->url, ref_map);
+ }
transport_unlock_pack(transport);
return ret;
}
@@ -368,6 +403,7 @@ static struct ref *find_non_local_tags(struct transport *transport,
struct ref *ref_map = NULL;
struct ref **tail = &ref_map;
const struct ref *ref;
+ struct object *obj;
for_each_ref(add_existing, &existing_refs);
for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
@@ -392,7 +428,8 @@ static struct ref *find_non_local_tags(struct transport *transport,
if (!path_list_has_path(&existing_refs, ref_name) &&
!path_list_has_path(&new_refs, ref_name) &&
- lookup_object(ref->old_sha1)) {
+ (obj = lookup_object(ref->old_sha1)) &&
+ obj->flags & SEEN) {
path_list_insert(ref_name, &new_refs);
rm = alloc_ref(strlen(ref_name) + 1);
diff --git a/t/t5515/fetch.br-branches-default b/t/t5515/fetch.br-branches-default
index 2e0414f..174ea02 100644
--- a/t/t5515/fetch.br-branches-default
+++ b/t/t5515/fetch.br-branches-default
@@ -2,7 +2,5 @@
754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-merge b/t/t5515/fetch.br-branches-default-merge
index ca2cc1d..e410d55 100644
--- a/t/t5515/fetch.br-branches-default-merge
+++ b/t/t5515/fetch.br-branches-default-merge
@@ -3,7 +3,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-merge_branches-default b/t/t5515/fetch.br-branches-default-merge_branches-default
index 7d947cd..f0f8230 100644
--- a/t/t5515/fetch.br-branches-default-merge_branches-default
+++ b/t/t5515/fetch.br-branches-default-merge_branches-default
@@ -3,7 +3,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-octopus b/t/t5515/fetch.br-branches-default-octopus
index ec39c54..f497ee3 100644
--- a/t/t5515/fetch.br-branches-default-octopus
+++ b/t/t5515/fetch.br-branches-default-octopus
@@ -4,7 +4,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-octopus_branches-default b/t/t5515/fetch.br-branches-default-octopus_branches-default
index 6bf42e2..a1694aa 100644
--- a/t/t5515/fetch.br-branches-default-octopus_branches-default
+++ b/t/t5515/fetch.br-branches-default-octopus_branches-default
@@ -4,7 +4,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default_branches-default b/t/t5515/fetch.br-branches-default_branches-default
index 4a2bf3c..eef9635 100644
--- a/t/t5515/fetch.br-branches-default_branches-default
+++ b/t/t5515/fetch.br-branches-default_branches-default
@@ -2,7 +2,5 @@
754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one b/t/t5515/fetch.br-branches-one
index 12ac8d2..629e0cf 100644
--- a/t/t5515/fetch.br-branches-one
+++ b/t/t5515/fetch.br-branches-one
@@ -2,7 +2,5 @@
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-merge b/t/t5515/fetch.br-branches-one-merge
index b4b3b35..62176a4 100644
--- a/t/t5515/fetch.br-branches-one-merge
+++ b/t/t5515/fetch.br-branches-one-merge
@@ -3,7 +3,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-merge_branches-one b/t/t5515/fetch.br-branches-one-merge_branches-one
index 2ecef38..13935fd 100644
--- a/t/t5515/fetch.br-branches-one-merge_branches-one
+++ b/t/t5515/fetch.br-branches-one-merge_branches-one
@@ -3,7 +3,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-octopus b/t/t5515/fetch.br-branches-one-octopus
index 96e3029..b42ab60 100644
--- a/t/t5515/fetch.br-branches-one-octopus
+++ b/t/t5515/fetch.br-branches-one-octopus
@@ -3,7 +3,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-octopus_branches-one b/t/t5515/fetch.br-branches-one-octopus_branches-one
index 55e0bad..c9868c0 100644
--- a/t/t5515/fetch.br-branches-one-octopus_branches-one
+++ b/t/t5515/fetch.br-branches-one-octopus_branches-one
@@ -3,7 +3,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one_branches-one b/t/t5515/fetch.br-branches-one_branches-one
index 281fa09..2592e3c 100644
--- a/t/t5515/fetch.br-branches-one_branches-one
+++ b/t/t5515/fetch.br-branches-one_branches-one
@@ -2,7 +2,5 @@
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit b/t/t5515/fetch.br-config-explicit
index e2fa9c8..a9a6573 100644
--- a/t/t5515/fetch.br-config-explicit
+++ b/t/t5515/fetch.br-config-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-merge b/t/t5515/fetch.br-config-explicit-merge
index ec1a723..5aa1a75 100644
--- a/t/t5515/fetch.br-config-explicit-merge
+++ b/t/t5515/fetch.br-config-explicit-merge
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-merge_config-explicit b/t/t5515/fetch.br-config-explicit-merge_config-explicit
index 54f6891..a3de0a3 100644
--- a/t/t5515/fetch.br-config-explicit-merge_config-explicit
+++ b/t/t5515/fetch.br-config-explicit-merge_config-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-octopus b/t/t5515/fetch.br-config-explicit-octopus
index 7011dfc..612aac9 100644
--- a/t/t5515/fetch.br-config-explicit-octopus
+++ b/t/t5515/fetch.br-config-explicit-octopus
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-octopus_config-explicit b/t/t5515/fetch.br-config-explicit-octopus_config-explicit
index bdad51f..a098d56 100644
--- a/t/t5515/fetch.br-config-explicit-octopus_config-explicit
+++ b/t/t5515/fetch.br-config-explicit-octopus_config-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit_config-explicit b/t/t5515/fetch.br-config-explicit_config-explicit
index 1b237dd..a744172 100644
--- a/t/t5515/fetch.br-config-explicit_config-explicit
+++ b/t/t5515/fetch.br-config-explicit_config-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob b/t/t5515/fetch.br-config-glob
index e75ec2f..d042adc 100644
--- a/t/t5515/fetch.br-config-glob
+++ b/t/t5515/fetch.br-config-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-merge b/t/t5515/fetch.br-config-glob-merge
index ce8f739..86f7f5f 100644
--- a/t/t5515/fetch.br-config-glob-merge
+++ b/t/t5515/fetch.br-config-glob-merge
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-merge_config-glob b/t/t5515/fetch.br-config-glob-merge_config-glob
index 5817bed..88c095f 100644
--- a/t/t5515/fetch.br-config-glob-merge_config-glob
+++ b/t/t5515/fetch.br-config-glob-merge_config-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-octopus b/t/t5515/fetch.br-config-glob-octopus
index 938e532..5a63ac9 100644
--- a/t/t5515/fetch.br-config-glob-octopus
+++ b/t/t5515/fetch.br-config-glob-octopus
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-octopus_config-glob b/t/t5515/fetch.br-config-glob-octopus_config-glob
index c9225bf..4de6fc8 100644
--- a/t/t5515/fetch.br-config-glob-octopus_config-glob
+++ b/t/t5515/fetch.br-config-glob-octopus_config-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob_config-glob b/t/t5515/fetch.br-config-glob_config-glob
index a6c20f9..c6a1ac7 100644
--- a/t/t5515/fetch.br-config-glob_config-glob
+++ b/t/t5515/fetch.br-config-glob_config-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit b/t/t5515/fetch.br-remote-explicit
index 83534d2..439c473 100644
--- a/t/t5515/fetch.br-remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-merge b/t/t5515/fetch.br-remote-explicit-merge
index a9064dd..338431c 100644
--- a/t/t5515/fetch.br-remote-explicit-merge
+++ b/t/t5515/fetch.br-remote-explicit-merge
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-merge_remote-explicit b/t/t5515/fetch.br-remote-explicit-merge_remote-explicit
index 732a37e..db75bb1 100644
--- a/t/t5515/fetch.br-remote-explicit-merge_remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit-merge_remote-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-octopus b/t/t5515/fetch.br-remote-explicit-octopus
index ecf020d..c265c43 100644
--- a/t/t5515/fetch.br-remote-explicit-octopus
+++ b/t/t5515/fetch.br-remote-explicit-octopus
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit b/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
index af77531..ff0072b 100644
--- a/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit_remote-explicit b/t/t5515/fetch.br-remote-explicit_remote-explicit
index 51fae56..a0a1480 100644
--- a/t/t5515/fetch.br-remote-explicit_remote-explicit
+++ b/t/t5515/fetch.br-remote-explicit_remote-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob b/t/t5515/fetch.br-remote-glob
index 94e6ad3..db59afb 100644
--- a/t/t5515/fetch.br-remote-glob
+++ b/t/t5515/fetch.br-remote-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-merge b/t/t5515/fetch.br-remote-glob-merge
index 09362e2..9a1edd0 100644
--- a/t/t5515/fetch.br-remote-glob-merge
+++ b/t/t5515/fetch.br-remote-glob-merge
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-merge_remote-glob b/t/t5515/fetch.br-remote-glob-merge_remote-glob
index e2eabec..569890c 100644
--- a/t/t5515/fetch.br-remote-glob-merge_remote-glob
+++ b/t/t5515/fetch.br-remote-glob-merge_remote-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-octopus b/t/t5515/fetch.br-remote-glob-octopus
index b08e046..1d1db0e 100644
--- a/t/t5515/fetch.br-remote-glob-octopus
+++ b/t/t5515/fetch.br-remote-glob-octopus
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-octopus_remote-glob b/t/t5515/fetch.br-remote-glob-octopus_remote-glob
index d4d547c..1649d5f 100644
--- a/t/t5515/fetch.br-remote-glob-octopus_remote-glob
+++ b/t/t5515/fetch.br-remote-glob-octopus_remote-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob_remote-glob b/t/t5515/fetch.br-remote-glob_remote-glob
index 646dbc8..5769be6 100644
--- a/t/t5515/fetch.br-remote-glob_remote-glob
+++ b/t/t5515/fetch.br-remote-glob_remote-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig b/t/t5515/fetch.br-unconfig
index 65ce6d9..ce9e098 100644
--- a/t/t5515/fetch.br-unconfig
+++ b/t/t5515/fetch.br-unconfig
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
index f02bab2..409b033 100644
--- a/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
+++ b/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
@@ -3,6 +3,5 @@
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
index 0da2337..b535401 100644
--- a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
+++ b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
@@ -2,6 +2,4 @@
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b tag 'tag-three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_branches-default b/t/t5515/fetch.br-unconfig_branches-default
index fc7041e..5787d50 100644
--- a/t/t5515/fetch.br-unconfig_branches-default
+++ b/t/t5515/fetch.br-unconfig_branches-default
@@ -2,7 +2,5 @@
754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_branches-one b/t/t5515/fetch.br-unconfig_branches-one
index e94cde7..7a98d64 100644
--- a/t/t5515/fetch.br-unconfig_branches-one
+++ b/t/t5515/fetch.br-unconfig_branches-one
@@ -2,7 +2,5 @@
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_config-explicit b/t/t5515/fetch.br-unconfig_config-explicit
index 01a283e..f618d4e 100644
--- a/t/t5515/fetch.br-unconfig_config-explicit
+++ b/t/t5515/fetch.br-unconfig_config-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_config-glob b/t/t5515/fetch.br-unconfig_config-glob
index 3a556c5..e47b27a 100644
--- a/t/t5515/fetch.br-unconfig_config-glob
+++ b/t/t5515/fetch.br-unconfig_config-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_remote-explicit b/t/t5515/fetch.br-unconfig_remote-explicit
index db216df..b2fe473 100644
--- a/t/t5515/fetch.br-unconfig_remote-explicit
+++ b/t/t5515/fetch.br-unconfig_remote-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_remote-glob b/t/t5515/fetch.br-unconfig_remote-glob
index aee65c2..83ef090 100644
--- a/t/t5515/fetch.br-unconfig_remote-glob
+++ b/t/t5515/fetch.br-unconfig_remote-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master b/t/t5515/fetch.master
index 950fd07..671945c 100644
--- a/t/t5515/fetch.master
+++ b/t/t5515/fetch.master
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file
index 8286852..67f9314 100644
--- a/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file
+++ b/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file
@@ -3,6 +3,5 @@
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three
index 92b18b4..ee914a3 100644
--- a/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three
+++ b/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three
@@ -2,6 +2,4 @@
8e32a6d901327a23ef831511badce7bf3bf46689 tag 'tag-one' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b tag 'tag-three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_branches-default b/t/t5515/fetch.master_branches-default
index 603d6d2..a40bb5a 100644
--- a/t/t5515/fetch.master_branches-default
+++ b/t/t5515/fetch.master_branches-default
@@ -2,7 +2,5 @@
754b754407bf032e9a2f9d5a9ad05ca79a6b228f branch 'master' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_branches-one b/t/t5515/fetch.master_branches-one
index fe9bb0b..3f8bdbc 100644
--- a/t/t5515/fetch.master_branches-one
+++ b/t/t5515/fetch.master_branches-one
@@ -2,7 +2,5 @@
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_config-explicit b/t/t5515/fetch.master_config-explicit
index 4be97c7..451750b 100644
--- a/t/t5515/fetch.master_config-explicit
+++ b/t/t5515/fetch.master_config-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_config-glob b/t/t5515/fetch.master_config-glob
index cb0726f..4fde761 100644
--- a/t/t5515/fetch.master_config-glob
+++ b/t/t5515/fetch.master_config-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_remote-explicit b/t/t5515/fetch.master_remote-explicit
index 44a1ca8..e5305b9 100644
--- a/t/t5515/fetch.master_remote-explicit
+++ b/t/t5515/fetch.master_remote-explicit
@@ -5,7 +5,5 @@
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_remote-glob b/t/t5515/fetch.master_remote-glob
index 724e8db..a96ce5f 100644
--- a/t/t5515/fetch.master_remote-glob
+++ b/t/t5515/fetch.master_remote-glob
@@ -5,7 +5,5 @@
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge tag 'tag-master' of ../
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c not-for-merge tag 'tag-three-file' of ../
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge tag 'tag-two' of ../
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
* [PATCH 06/11] git-fetch: Release objects used by a prior transport
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Some transports allocate objects in the internal object hashtable
during the fetch process (e.g. the HTTP commit walker and also the
native protocol). These shouldn't be visible to another transport
call running in the same fetch process when we fetch the tags during
automated tag following. By deallocating the object table (if it
has anything in it) we ensure the second transport execution will
be from a clean slate.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
builtin-fetch.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 847db73..18f123e 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -337,7 +337,10 @@ static void store_updated_refs(const char *url, struct ref *ref_map)
static int fetch_refs(struct transport *transport, struct ref *ref_map)
{
- int ret = transport_fetch_refs(transport, ref_map);
+ int ret;
+
+ free_all_objects();
+ ret = transport_fetch_refs(transport, ref_map);
if (!ret)
store_updated_refs(transport->url, ref_map);
transport_unlock_pack(transport);
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
* [PATCH 04/11] Allow pooled nodes to be recycled back onto a free list
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In some cases and for some node types a caller may have used one of
our allocated nodes for some temporary usage and then wants to return
it back to the available free list. We now define a function that
will thread the object onto the front of a free list, which will be
used only after the current block has been exhausted.
We hold off on looking at the free list until we are sure the current
block is empty. This saves about 1000 tests of the (usually empty)
free list per block.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
alloc.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/alloc.c b/alloc.c
index aa429ec..5737a73 100644
--- a/alloc.c
+++ b/alloc.c
@@ -26,6 +26,7 @@ struct node_block
struct node_pool
{
struct node_block *block_list;
+ void *free_list;
char *base;
size_t nr;
};
@@ -38,15 +39,22 @@ struct node_pool
static void report(const char* name, struct node_pool *p, size_t sz)
{
- unsigned int count = 0;
+ unsigned int count = 0, free = 0;
struct node_block *b;
+ void **f;
for (b = p->block_list; b; b = b->next)
count += BLOCKING;
+ for (f = p->free_list; f; f = *f)
+ free++;
+ free += p->nr;
count -= p->nr;
sz = (count * sz) >> 10;
- fprintf(stderr, "%10s: %8u (" SZ_FMT " kB)\n", name, count, sz);
+ fprintf(stderr, "%10s: %8u (" SZ_FMT " kB)", name, count, sz);
+ if (free)
+ fprintf(stderr, ", %8u on free list", free);
+ fputc('\n', stderr);
}
#undef SZ_FMT
@@ -59,6 +67,12 @@ void *alloc_##name##_node(void) \
\
if (!name##_pool.nr) { \
struct node_block *b; \
+ if (name##_pool.free_list) { \
+ ret = name##_pool.free_list; \
+ name##_pool.free_list = *((void**)ret); \
+ memset(ret, 0, sizeof(t)); \
+ return ret; \
+ } \
b = xmalloc(sizeof(*b) + BLOCKING * sizeof(t)); \
b->next = name##_pool.block_list; \
name##_pool.block_list = b; \
@@ -71,6 +85,11 @@ void *alloc_##name##_node(void) \
memset(ret, 0, sizeof(t)); \
return ret; \
} \
+void free_##name##_node(void *n) \
+{ \
+ *((void**)n) = name##_pool.free_list; \
+ name##_pool.free_list = n; \
+} \
static void report_##name(void) \
{ \
report(#name, &name##_pool, sizeof(t)); \
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
* [PATCH 05/11] Bulk allocate struct commit_list, as we do for struct commit
From: Shawn O. Pearce @ 2007-11-09 11:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Typically every commit has at least one struct commit_list allocated
for its parent. It is also not uncommon for there to be more than
one allocated per commit, especially if merges are common in this
repository.
Running `git rev-list --all` doesn't usually wind up requiring many
commit_list items (about 1024 for git.git right now) as the commits
are output as soon as they are first seen and then the parent list
is freed as it is no longer necessary for traversal. However when
we add --topo-order or --date-order and request sorting the lists
are not deallocated until after sorting is complete. Any memory
they consume during that time just increases our footprint.
In git.git for 15865 commits we need 50354 commit_lists to complete
a --topo-order sort. That's an average of 3 commit_list items per
commit (I blame my local reflogs of Junio's pu branch for the high
ratio of commits to their parents). With that kind of allocation
individually mallocing them is wasting a lot of memory for these
very small and otherwise lightwight objects.
Aside from reducing our memory usage during the --topo-order
sorting case a major benefit from allocating these by blocks is we
can release them enmass when we release the other objects in the
object pool. This reduces the cost of the scrub_commit() function
as it no longer needs to free each parent entry individually.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
alloc.c | 5 ++++-
builtin-diff-tree.c | 8 ++------
builtin-rev-parse.c | 2 +-
builtin-send-pack.c | 2 +-
builtin-show-branch.c | 2 +-
cache.h | 2 ++
commit.c | 13 ++++++-------
http-push.c | 2 +-
reflog-walk.c | 2 +-
revision.c | 6 +++---
upload-pack.c | 2 +-
11 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/alloc.c b/alloc.c
index 5737a73..b69f613 100644
--- a/alloc.c
+++ b/alloc.c
@@ -51,7 +51,7 @@ static void report(const char* name, struct node_pool *p, size_t sz)
count -= p->nr;
sz = (count * sz) >> 10;
- fprintf(stderr, "%10s: %8u (" SZ_FMT " kB)", name, count, sz);
+ fprintf(stderr, "%15s: %8u (" SZ_FMT " kB)", name, count, sz);
if (free)
fprintf(stderr, ", %8u on free list", free);
fputc('\n', stderr);
@@ -144,6 +144,7 @@ static void scrub_any_object(union any_object *o)
}
}
+DEFINE_ALLOCATOR(commit_list, struct commit_list)
DEFINE_ALLOCATOR(blob, struct blob)
DEFINE_SCRUBBING_ALLOCATOR(tree, struct tree, scrub_tree)
DEFINE_SCRUBBING_ALLOCATOR(commit, struct commit, scrub_commit)
@@ -155,6 +156,7 @@ void alloc_report(void)
report_blob();
report_tree();
report_commit();
+ report_commit_list();
report_tag();
report_object();
}
@@ -164,6 +166,7 @@ void alloc_free_everything(void)
free_all_blob();
free_all_tree();
free_all_commit();
+ free_all_commit_list();
free_all_tag();
free_all_object();
}
diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c
index 0b591c8..eb340d2 100644
--- a/builtin-diff-tree.c
+++ b/builtin-diff-tree.c
@@ -31,14 +31,10 @@ static int diff_tree_stdin(char *line)
if (isspace(line[40]) && !get_sha1_hex(line+41, sha1)) {
/* Graft the fake parents locally to the commit */
int pos = 41;
- struct commit_list **pptr, *parents;
+ struct commit_list **pptr;
/* Free the real parent list */
- for (parents = commit->parents; parents; ) {
- struct commit_list *tmp = parents->next;
- free(parents);
- parents = tmp;
- }
+ free_commit_list(commit->parents);
commit->parents = NULL;
pptr = &(commit->parents);
while (line[pos] && !get_sha1_hex(line + pos, sha1)) {
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index d1038a0..7500814 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -200,7 +200,7 @@ static int try_difference(const char *arg)
struct commit_list *n = exclude->next;
show_rev(REVERSED,
exclude->item->object.sha1,NULL);
- free(exclude);
+ free_commit_list_node(exclude);
exclude = n;
}
}
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 5a0f5c6..818519e 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -82,7 +82,7 @@ static void unmark_and_free(struct commit_list *list, unsigned int mark)
struct commit_list *temp = list;
temp->item->object.flags &= ~mark;
list = temp->next;
- free(temp);
+ free_commit_list_node(temp);
}
}
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 6dc835d..f10377c 100644
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -38,7 +38,7 @@ static struct commit *pop_one_commit(struct commit_list **list_p)
list = *list_p;
commit = list->item;
*list_p = list->next;
- free(list);
+ free_commit_list_node(list);
return commit;
}
diff --git a/cache.h b/cache.h
index 8289de1..a33c8ee 100644
--- a/cache.h
+++ b/cache.h
@@ -586,6 +586,8 @@ extern void *alloc_tree_node(void);
extern void *alloc_commit_node(void);
extern void *alloc_tag_node(void);
extern void *alloc_object_node(void);
+extern void *alloc_commit_list_node(void);
+extern void free_commit_list_node(void *);
extern void alloc_report(void);
extern void alloc_free_everything(void);
diff --git a/commit.c b/commit.c
index 05f3cd6..796fc59 100644
--- a/commit.c
+++ b/commit.c
@@ -320,13 +320,12 @@ int parse_commit(struct commit *item)
void scrub_commit(struct commit *item)
{
- free_commit_list(item->parents);
free(item->buffer);
}
struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p)
{
- struct commit_list *new_list = xmalloc(sizeof(struct commit_list));
+ struct commit_list *new_list = alloc_commit_list_node();
new_list->item = item;
new_list->next = *list_p;
*list_p = new_list;
@@ -338,7 +337,7 @@ void free_commit_list(struct commit_list *list)
while (list) {
struct commit_list *temp = list;
list = temp->next;
- free(temp);
+ free_commit_list_node(temp);
}
}
@@ -374,7 +373,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
struct commit_list *old = *list;
*list = (*list)->next;
- free(old);
+ free_commit_list_node(old);
while (parents) {
struct commit *commit = parents->item;
@@ -416,7 +415,7 @@ struct commit *pop_commit(struct commit_list **stack)
if (top) {
*stack = top->next;
- free(top);
+ free_commit_list_node(top);
}
return item;
}
@@ -561,7 +560,7 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
commit = list->item;
n = list->next;
- free(list);
+ free_commit_list_node(list);
list = n;
flags = commit->object.flags & (PARENT1 | PARENT2 | STALE);
@@ -592,7 +591,7 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
struct commit_list *n = list->next;
if (!(list->item->object.flags & STALE))
insert_by_date(list->item, &result);
- free(list);
+ free_commit_list_node(list);
list = n;
}
return result;
diff --git a/http-push.c b/http-push.c
index 99328f5..75f1664 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1931,7 +1931,7 @@ static void unmark_and_free(struct commit_list *list, unsigned int mark)
struct commit_list *temp = list;
temp->item->object.flags &= ~mark;
list = temp->next;
- free(temp);
+ free_commit_list_node(temp);
}
}
diff --git a/reflog-walk.c b/reflog-walk.c
index ee1456b..a6cc6ca 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -236,7 +236,7 @@ void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit)
return;
}
- commit->parents = xcalloc(sizeof(struct commit_list), 1);
+ commit->parents = alloc_commit_list_node();
commit->parents->item = commit_info->commit;
commit->object.flags &= ~(ADDED | SEEN | SHOWN);
}
diff --git a/revision.c b/revision.c
index 931f978..d9c3998 100644
--- a/revision.c
+++ b/revision.c
@@ -554,7 +554,7 @@ static int limit_list(struct rev_info *revs)
show_early_output_fn_t show;
list = list->next;
- free(entry);
+ free_commit_list_node(entry);
if (revs->max_age != -1 && (commit->date < revs->max_age))
obj->flags |= UNINTERESTING;
@@ -735,7 +735,7 @@ static void prepare_show_merge(struct rev_info *revs)
while (bases) {
struct commit *it = bases->item;
struct commit_list *n = bases->next;
- free(bases);
+ free_commit_list_node(bases);
bases = n;
it->object.flags |= UNINTERESTING;
add_pending_object(revs, &it->object, "(merge-base)");
@@ -1451,7 +1451,7 @@ static struct commit *get_revision_1(struct rev_info *revs)
struct commit *commit = entry->item;
revs->commits = entry->next;
- free(entry);
+ free_commit_list_node(entry);
if (revs->reflog_info)
fake_reflog_parent(revs->reflog_info, commit);
diff --git a/upload-pack.c b/upload-pack.c
index 7e04311..51796dc 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -331,7 +331,7 @@ static int reachable(struct commit *want)
while (work) {
struct commit_list *list = work->next;
struct commit *commit = work->item;
- free(work);
+ free_commit_list_node(work);
work = list;
if (commit->object.flags & THEY_HAVE) {
--
1.5.3.5.1622.g41d10
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox