# tags and patches

10 messages from 2007-06-13 to 2007-06-14. Participants: Geoff Russell, Pierre Habouzit, Johannes Schindelin, Jeff King.
Thread: https://gitlist.dev/t/8587

## Geoff Russell, 2007-06-13 10:52

Subject: tags and patches
Message-ID: <93c3eada0706130352h3ad6857eie01e1171fdda3991@mail.gmail.com>
URL: https://gitlist.dev/e/93c3eada0706130352h3ad6857eie01e1171fdda3991%40mail.gmail.com

```
Dear gits,

(I'm on 1.5.0.5)

The last tag made seems to be missing from a patch ... eg.

        cd ~ ; mkdir myrepo ; cd myrepo
        git init-db ; echo STUFF > xxx ; git add xxx
        # work, work, work on xxx
        git commit -a
        git tag v1.0
        # work work work on xxx
        # then I clone this repository
        cd /tmp ; git clone ~/myrepo newmyrepo
        # go back and work some more
        cd ~/myrepo
        echo YYY >>xxx
        git commit -a
        git tag v1.1
        # is git commit -a required to commit the tag???
        git format-patch v1.0
        cd /tmp/newmyrepo
        git am ~/myrepo/THEPATCHNAME
        git tag ls

Where is tag v1.1 ?

Cheers,
Geoff Russell

```

## Pierre Habouzit, 2007-06-13 11:04

Subject: Re: tags and patches
Message-ID: <20070613110401.GG21684@artemis.intersec.eu>
URL: https://gitlist.dev/e/20070613110401.GG21684%40artemis.intersec.eu
In-Reply-To: <93c3eada0706130352h3ad6857eie01e1171fdda3991@mail.gmail.com>

```
On Wed, Jun 13, 2007 at 08:22:23PM +0930, Geoff Russell wrote:
> Dear gits,
> 
> (I'm on 1.5.0.5)
> 
> The last tag made seems to be missing from a patch ... eg.
> 
>        cd ~ ; mkdir myrepo ; cd myrepo
>        git init-db ; echo STUFF > xxx ; git add xxx
>        # work, work, work on xxx
>        git commit -a
>        git tag v1.0
>        # work work work on xxx
>        # then I clone this repository
>        cd /tmp ; git clone ~/myrepo newmyrepo
>        # go back and work some more
>        cd ~/myrepo
>        echo YYY >>xxx
>        git commit -a
>        git tag v1.1
>        # is git commit -a required to commit the tag???
>        git format-patch v1.0
>        cd /tmp/newmyrepo
>        git am ~/myrepo/THEPATCHNAME
>        git tag ls

  git tag ls is not the proper way to list tags. Afaict there isn't any
yet, except: ls .git/refs/tags/

  git tag ls just tagged your HEAD with the name 'ls' which is obviously
not what you meant :)

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

```

## Geoff Russell, 2007-06-13 12:04

Subject: Re: tags and patches
Message-ID: <93c3eada0706130504g7f405b8ercd093b585b364eb5@mail.gmail.com>
URL: https://gitlist.dev/e/93c3eada0706130504g7f405b8ercd093b585b364eb5%40mail.gmail.com
In-Reply-To: <20070613110401.GG21684@artemis.intersec.eu>

```
On 6/13/07, Pierre Habouzit <madcoder@debian.org> wrote:
> On Wed, Jun 13, 2007 at 08:22:23PM +0930, Geoff Russell wrote:
> > Dear gits,
> >
> > (I'm on 1.5.0.5)
> >
> > The last tag made seems to be missing from a patch ... eg.
> >
> >        cd ~ ; mkdir myrepo ; cd myrepo
> >        git init-db ; echo STUFF > xxx ; git add xxx
> >        # work, work, work on xxx
> >        git commit -a
> >        git tag v1.0
> >        # work work work on xxx
> >        # then I clone this repository
> >        cd /tmp ; git clone ~/myrepo newmyrepo
> >        # go back and work some more
> >        cd ~/myrepo
> >        echo YYY >>xxx
> >        git commit -a
> >        git tag v1.1
> >        # is git commit -a required to commit the tag???
> >        git format-patch v1.0
> >        cd /tmp/newmyrepo
> >        git am ~/myrepo/THEPATCHNAME
> >        git tag ls
>
>   git tag ls is not the proper way to list tags. Afaict there isn't any
> yet, except: ls .git/refs/tags/
>
>   git tag ls just tagged your HEAD with the name 'ls' which is obviously
> not what you meant :)

Ooops. Yes, I meant "git tag -l" as the last command, which lists the tags,
but doesn't list v1.1.

Geoff.

>
> --
> ·O·  Pierre Habouzit
> ··O                                                madcoder@debian.org
> OOO                                                http://www.madism.org
>
>

```

## Johannes Schindelin, 2007-06-13 12:14

Subject: Re: tags and patches
Message-ID: <Pine.LNX.4.64.0706131313550.4059@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0706131313550.4059%40racer.site
In-Reply-To: <93c3eada0706130352h3ad6857eie01e1171fdda3991@mail.gmail.com>

```
Hi,

On Wed, 13 Jun 2007, Geoff Russell wrote:

> Dear gits,

;-)

> [...]
>
>        git tag v1.1
>        git format-patch v1.0
>        cd /tmp/newmyrepo
>        git am ~/myrepo/THEPATCHNAME
> 
> Where is tag v1.1 ?

Tags are not propagated with patches. Sorry.

Ciao,
Dscho

```

## Geoff Russell, 2007-06-14 00:15

Subject: Re: tags and patches
Message-ID: <93c3eada0706131715oa84eff7kc0b477a3b80e9d66@mail.gmail.com>
URL: https://gitlist.dev/e/93c3eada0706131715oa84eff7kc0b477a3b80e9d66%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0706131313550.4059@racer.site>

```
On 6/13/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Wed, 13 Jun 2007, Geoff Russell wrote:
>
> > Dear gits,
>
> ;-)
>
> > [...]
> >
> >        git tag v1.1
> >        git format-patch v1.0
> >        cd /tmp/newmyrepo
> >        git am ~/myrepo/THEPATCHNAME
> >
> > Where is tag v1.1 ?
>
> Tags are not propagated with patches. Sorry.

Is this considered to be a bug to be eventually fixed or a feature?

Geoff


>
> Ciao,
> Dscho
>
>

```

## Johannes Schindelin, 2007-06-14 01:03

Subject: Re: tags and patches
Message-ID: <Pine.LNX.4.64.0706140201400.4059@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0706140201400.4059%40racer.site
In-Reply-To: <93c3eada0706131715oa84eff7kc0b477a3b80e9d66@mail.gmail.com>

```
Hi,

On Thu, 14 Jun 2007, Geoff Russell wrote:

> On 6/13/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Hi,
> > 
> > On Wed, 13 Jun 2007, Geoff Russell wrote:
> > 
> > > Dear gits,
> > 
> > ;-)
> > 
> > > [...]
> > >
> > >        git tag v1.1
> > >        git format-patch v1.0
> > >        cd /tmp/newmyrepo
> > >        git am ~/myrepo/THEPATCHNAME
> > >
> > > Where is tag v1.1 ?
> > 
> > Tags are not propagated with patches. Sorry.
> 
> Is this considered to be a bug to be eventually fixed or a feature?

AFAIK patches are not supposed to _contain_ patches.

What you want is probably a bundle. You don't want a collection of diffs 
with comments on them, but you want a collection to reacreate the history 
the other side has.

Ciao,
Dscho

```

## Geoff Russell, 2007-06-14 02:05

Subject: Re: tags and patches
Message-ID: <93c3eada0706131905i1cd43fd2xcc44ce47dca8ce00@mail.gmail.com>
URL: https://gitlist.dev/e/93c3eada0706131905i1cd43fd2xcc44ce47dca8ce00%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0706140201400.4059@racer.site>

```
On 6/14/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Thu, 14 Jun 2007, Geoff Russell wrote:
>
> > On 6/13/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > Hi,
> > >
> > > On Wed, 13 Jun 2007, Geoff Russell wrote:
> > >
> > > > Dear gits,
> > >
> > > ;-)
> > >
> > > > [...]
> > > >
> > > >        git tag v1.1
> > > >        git format-patch v1.0
> > > >        cd /tmp/newmyrepo
> > > >        git am ~/myrepo/THEPATCHNAME
> > > >
> > > > Where is tag v1.1 ?
> > >
> > > Tags are not propagated with patches. Sorry.
> >
> > Is this considered to be a bug to be eventually fixed or a feature?
>
> AFAIK patches are not supposed to _contain_ patches.

Is this a typo? I expected patches to contain tags, not other patches.

>
> What you want is probably a bundle. You don't want a collection of diffs
> with comments on them, but you want a collection to reacreate the history
> the other side has.

I didn't know about bundles but do now.  However "git bundle --help" tells
me "No manual entry for git-bundle" despite
git-bundle.html being in the Documentation directory.

I'm trying to work out if I want to use git to manage a software distribution
problem. I distribute release v1.0 to people then later I want to email them
a patch to take them from v1.0 to v1.1.  I can probably live without
the tags, but
am just surprised that patches don't send them.


Cheers,
Geoff

>
> Ciao,
> Dscho
>
>

```

## Jeff King, 2007-06-14 02:19

Subject: Re: tags and patches
Message-ID: <20070614021939.GA18325@segfault.peff.net>
URL: https://gitlist.dev/e/20070614021939.GA18325%40segfault.peff.net
In-Reply-To: <93c3eada0706131905i1cd43fd2xcc44ce47dca8ce00@mail.gmail.com>

```
On Thu, Jun 14, 2007 at 11:35:35AM +0930, Geoff Russell wrote:

> I'm trying to work out if I want to use git to manage a software
> distribution problem. I distribute release v1.0 to people then later I
> want to email them a patch to take them from v1.0 to v1.1.  I can
> probably live without the tags, but am just surprised that patches
> don't send them.

Patches represent differences in _content_, but they don't show history.
So while git supports a somewhat extended patch format (supporting
things like renames and file modes), patches don't know anything about
branches, parent commits, or tags.

If you are trying to take people from v1.0 to v1.1, the best way depends
on their setup:

  - If they are all running git, then you can have them 'pull' from your
    repository
  - If you don't like that for some reason, you can send them a bundle,
    which is the moral equivalent of pulling (except that you've pushed
    through a non-interactive medium, but the end result in their
    repository is the same)
  - If they aren't running git, then you can use git to prepare the
    patch by tagging your own repository, and then creating either a
    patch series (git-format-patch v1.0..v1.1) or a single big patch
    (git-diff v1.0..v1.1). But either way, what would it mean to have a
    tag in the patch, since they don't have a tagging system at the
    other end?

I'm not really sure what you're trying to accomplish; if you can be more
concrete, we might be able to offer more concrete solutions (or maybe
the answer you were looking for was simply, "you want bundles, not
patches").

-Peff

```

## Johannes Schindelin, 2007-06-14 02:31

Subject: Re: tags and patches
Message-ID: <Pine.LNX.4.64.0706140326350.4059@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0706140326350.4059%40racer.site
In-Reply-To: <93c3eada0706131905i1cd43fd2xcc44ce47dca8ce00@mail.gmail.com>

```
Hi,

On Thu, 14 Jun 2007, Geoff Russell wrote:

> On 6/14/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > AFAIK patches are not supposed to _contain_ patches.
> 
> Is this a typo? I expected patches to contain tags, not other patches.

Actually, two typos. Sorry. "AFAIK" -> "AFAICT", and the rest should 
actually have been written as "formatted patches are not supposed to 
contain tags."

> > What you want is probably a bundle. You don't want a collection of 
> > diffs with comments on them, but you want a collection to reacreate 
> > the history the other side has.
> 
> I didn't know about bundles but do now.  However "git bundle --help" 
> tells me "No manual entry for git-bundle" despite git-bundle.html being 
> in the Documentation directory.

... which probably means that your man pages, and therefore your Git 
installation, is not up-to-date.

> I'm trying to work out if I want to use git to manage a software 
> distribution problem. I distribute release v1.0 to people then later I 
> want to email them a patch to take them from v1.0 to v1.1.  I can 
> probably live without the tags, but am just surprised that patches don't 
> send them.

Patches are just files of the format that "diff" outputs, and "patch" 
accepts. There was never any possibility to change anything but files.

But then, usually people put the version _into_ files. So I suspect you 
really don't need tags, if you _have_ to send patches. Because if you 
_have_ to send patches, your recipients probably don't use Git, and could 
not use those tags anyway.

Ciao,
Dscho

```

## Geoff Russell, 2007-06-14 02:50

Subject: Re: tags and patches
Message-ID: <93c3eada0706131950y7a27cf39i1326d34535e7f5e9@mail.gmail.com>
URL: https://gitlist.dev/e/93c3eada0706131950y7a27cf39i1326d34535e7f5e9%40mail.gmail.com
In-Reply-To: <20070614021939.GA18325@segfault.peff.net>

```
On 6/14/07, Jeff King <peff@peff.net> wrote:
> On Thu, Jun 14, 2007 at 11:35:35AM +0930, Geoff Russell wrote:
>
> > I'm trying to work out if I want to use git to manage a software
> > distribution problem. I distribute release v1.0 to people then later I
> > want to email them a patch to take them from v1.0 to v1.1.  I can
> > probably live without the tags, but am just surprised that patches
> > don't send them.
>
> Patches represent differences in _content_, but they don't show history.
> So while git supports a somewhat extended patch format (supporting
> things like renames and file modes), patches don't know anything about
> branches, parent commits, or tags.
>
> If you are trying to take people from v1.0 to v1.1, the best way depends
> on their setup:
>
>   - If they are all running git, then you can have them 'pull' from your
>     repository
>   - If you don't like that for some reason, you can send them a bundle,
>     which is the moral equivalent of pulling (except that you've pushed
>     through a non-interactive medium, but the end result in their
>     repository is the same)
>   - If they aren't running git, then you can use git to prepare the
>     patch by tagging your own repository, and then creating either a
>     patch series (git-format-patch v1.0..v1.1) or a single big patch
>     (git-diff v1.0..v1.1). But either way, what would it mean to have a
>     tag in the patch, since they don't have a tagging system at the
>     other end?
>
> I'm not really sure what you're trying to accomplish; if you can be more
> concrete, we might be able to offer more concrete solutions (or maybe
> the answer you were looking for was simply, "you want bundles, not
> patches").

Ok (in english we have an expression "the penny has dropped" :)), I understand
my confusion and no longer am surprised that patches don't have tags!
I think that we will ensure everyone is running git (but we will ssh into their
machines and do the appropriate pulls).

Many thanks for your help and patience,

Cheers,
Geoff



>
> -Peff
>

```
