threads / discuss / 8587

tags and patches

Subject: tags and patches

## tl;dr

10 messages between Jun 13, 2007 and Jun 14, 2007.

replies: 9people: 4as markdown or json

Geoff Russell· Jun 13, 2007, 10:52 UTC · lore
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· Jun 13, 2007, 11:04 UTC · re: Geoff Russell · lore

Re: tags and patches

On Wed, Jun 13, 2007 at 08:22:23PM +0930, Geoff Russell wrote:
Show 24 quoted lines
> 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· Jun 13, 2007, 12:04 UTC · re: Pierre Habouzit · lore

Re: tags and patches

On 6/13/07, Pierre Habouzit <madcoder@debian.org> wrote:
Show 31 quoted lines
> 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.
Show 7 quoted lines
>
> --
> ·O·  Pierre Habouzit
> ··O                                                madcoder@debian.org
> OOO                                                http://www.madism.org
>
>
Johannes Schindelin· Jun 13, 2007, 12:14 UTC · re: Geoff Russell · lore

Re: tags and patches

Hi,
On Wed, 13 Jun 2007, Geoff Russell wrote:
> Dear gits,
;-)
Show 8 quoted lines
> [...]
>
>        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· Jun 14, 2007, 00:15 UTC · re: Johannes Schindelin · lore

Re: tags and patches

On 6/13/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 18 quoted lines
> 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
Show 5 quoted lines
>
> Ciao,
> Dscho
>
>
Johannes Schindelin· Jun 14, 2007, 01:03 UTC · re: Geoff Russell · lore

Re: tags and patches

Hi,
On Thu, 14 Jun 2007, Geoff Russell wrote:
Show 21 quoted lines
> 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· Jun 14, 2007, 02:05 UTC · re: Johannes Schindelin · lore

Re: tags and patches

On 6/14/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 27 quoted lines
> 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

Show 5 quoted lines
>
> Ciao,
> Dscho
>
>
Jeff King· Jun 14, 2007, 02:19 UTC · re: Geoff Russell · lore

Re: tags and patches

On Thu, Jun 14, 2007 at 11:35:35AM +0930, Geoff Russell wrote:
Show 5 quoted lines
> 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
Geoff Russell· Jun 14, 2007, 02:50 UTC · re: Jeff King · lore

Re: tags and patches

On 6/14/07, Jeff King <peff@peff.net> wrote:
Show 33 quoted lines
> 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
>
Johannes Schindelin· Jun 14, 2007, 02:31 UTC · re: Geoff Russell · lore

Re: tags and patches

Hi,
On Thu, 14 Jun 2007, Geoff Russell wrote:
Show 5 quoted lines
> 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."

Show 7 quoted lines
> > 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.

Show 5 quoted lines
> 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

← back to recent threads