# [PATCH] Document --ignore-if-in-upstream in git-format-patch

5 messages from 2007-01-18 to 2007-01-19. Participants: David Kågedal, Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/6425

## David Kågedal, 2007-01-18 11:27

Subject: [PATCH] Document --ignore-if-in-upstream in git-format-patch
Message-ID: <8764b4fuc8.fsf@morpheus.local>
URL: https://gitlist.dev/e/8764b4fuc8.fsf%40morpheus.local

```

---
 Documentation/git-format-patch.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

I looked at the code, and tried to guess what it actually did.  This
documentation doesn't really explain how or why it's supposed to be
used.

Someone who knows how it *actually* works is encouraged to send a
better explanation.

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 67425dc..3ad0fcd 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -12,6 +12,7 @@ SYNOPSIS
 'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--thread]
 	           [-s | --signoff] [--diff-options] [--start-number <n>]
 		   [--in-reply-to=Message-Id]
+		   [--ignore-if-in-upstream]
 		   <since>[..<until>]
 
 DESCRIPTION
@@ -78,6 +79,11 @@ OPTIONS
 	reply to the given Message-Id, which avoids breaking threads to
 	provide a new patch series.
 
+--ignore-if-in-upstream::
+	Do not include the same patch twice.  If there are two commits
+	that would produce identical patches, the second one is
+	excluded from the output.
+
 CONFIGURATION
 -------------
 You can specify extra mail header lines to be added to each
-- 
1.5.0.rc1.g04f3-dirty


-- 
David Kågedal

```

## Johannes Schindelin, 2007-01-18 13:40

Subject: Re: [PATCH] Document --ignore-if-in-upstream in git-format-patch
Message-ID: <Pine.LNX.4.63.0701181437200.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0701181437200.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <8764b4fuc8.fsf@morpheus.local>

```
Hi,

On Thu, 18 Jan 2007, David Kågedal wrote:

> Someone who knows how it *actually* works is encouraged to send a
> better explanation.

Nice try... Unfortunately, I don't have time to do it.

> +--ignore-if-in-upstream::
> +	Do not include the same patch twice.  If there are two commits
> +	that would produce identical patches, the second one is
> +	excluded from the output.

This is not what it does, though. (If in doubt, use the source, Luke).

Given a range upstream..localbranch, --ignore-if-in-upstream looks at all 
diffs associated with commits in localbranch..upstream (i.e. all commits 
upstream has, but not localbranch), and when traversing 
upstream..localbranch to output the commits with diffs, drops those at the 
floor which were already seen in localbranch..upstream.

The way it does this is by hashing the diffs, and check only the hashes.

Ciao,
Dscho

```

## David Kågedal, 2007-01-18 14:13

Subject: Re: [PATCH] Document --ignore-if-in-upstream in git-format-patch
Message-ID: <87wt3ke82t.fsf@morpheus.local>
URL: https://gitlist.dev/e/87wt3ke82t.fsf%40morpheus.local
In-Reply-To: <Pine.LNX.4.63.0701181437200.22628@wbgn013.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Thu, 18 Jan 2007, David Kågedal wrote:
>
>> Someone who knows how it *actually* works is encouraged to send a
>> better explanation.
>
> Nice try... Unfortunately, I don't have time to do it.
>
>> +--ignore-if-in-upstream::
>> +	Do not include the same patch twice.  If there are two commits
>> +	that would produce identical patches, the second one is
>> +	excluded from the output.
>
> This is not what it does, though. (If in doubt, use the source, Luke).

I did.  But I haven't learnt to navigate it yet.  I get confused by
the global state in the code, which makes it hard to know when I
function call returns interesting information or changes some global
table.

> Given a range upstream..localbranch, --ignore-if-in-upstream looks at all 
> diffs associated with commits in localbranch..upstream (i.e. all commits 
> upstream has, but not localbranch), and when traversing 
> upstream..localbranch to output the commits with diffs, drops those at the 
> floor which were already seen in localbranch..upstream.

Ah, now I see.  How about this, then:

+--ignore-if-in-upstream::
+       Do not include a patch that matches a commit in
+       <until>..<since>.  This will examine all patches reachable
+       from <since> but not from <until> and compare them with the
+       patches being generated, and any patch that matches is
+       ignored.

It's hard to get something readable without writing lots about what
<since>..<until> actually means.  Which might actually be a good idea
to do. But I don't have time to do that :-)

-- 
David Kågedal

```

## Johannes Schindelin, 2007-01-18 14:18

Subject: Re: [PATCH] Document --ignore-if-in-upstream in git-format-patch
Message-ID: <Pine.LNX.4.63.0701181518150.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0701181518150.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <87wt3ke82t.fsf@morpheus.local>

```
Hi,

On Thu, 18 Jan 2007, David Kågedal wrote:

> +--ignore-if-in-upstream::
> +       Do not include a patch that matches a commit in
> +       <until>..<since>.  This will examine all patches reachable
> +       from <since> but not from <until> and compare them with the
> +       patches being generated, and any patch that matches is
> +       ignored.

Melikes.

```

## Junio C Hamano, 2007-01-19 16:58

Subject: Re: [PATCH] Document --ignore-if-in-upstream in git-format-patch
Message-ID: <7vlkjzhs2i.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vlkjzhs2i.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <87wt3ke82t.fsf@morpheus.local>

```
Thanks both.

```
