git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Andreas Grünbacher" <andreas.gruenbacher@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Apply git bundle to source tree?
Date: Fri, 18 Sep 2020 08:41:05 -0700	[thread overview]
Message-ID: <xmqqbli3nlda.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAHpGcMJqmUmCR_u3fxSVppzwBo8_6RJG5-WLrXAWXm+OQ6_3bA@mail.gmail.com> ("Andreas Grünbacher"'s message of "Fri, 18 Sep 2020 13:13:52 +0200")

Andreas Grünbacher <andreas.gruenbacher@gmail.com> writes:

> I'm wondering if there's a way to apply a particular head in a bundle
> to a source tree, for example:
>
>   $ git bundle create v5.9-rc1.bundle v5.8..v5.9-rc1
>   $ cd linux-5.8
>   $ git bundle APPLY ../5.9-rc1.bundle v5.9-rc1
>
> That would allow to reconstruct either the original repository or just
> the underlying source tree, so the bundle could be used as a kind of
> super diff.

There seem to be a bit of misconception.

Do not think that a bundle is like a patch.  When you created the
bundle in the above example, you did not create a "super diff"
between v5.8 and v5.9-rc1 that you can apply to a working tree files
that correspond to v5.8 release.  That is not what you did.

What you created is an equivalent of a (shallow) repository, that
contains everything needed to get v5.9-rc1 by those who have a Git
repository that has v5.8 to fetch/pull from.  It is OK to have more,
but you MUST have v5.8 for the bundle in the example to be usable.

So assuming that your 'linux-5.8' is not just a tarball extract but
a Linux repository with v5.8 tag in it (i.e. "git log v5.8" gives
you sensible output) then the command to use is not apply but fetch,
e.g.

    $ git bundle fetch ../5.9-rc1.bundle v5.9-rc1

which will give you v5.9-rc1 tag.  What you can fetch from the bundle
can be listed by using the list-heads subcommand on the bundle.

And starting from that point, you would be able to do things like

    $ git checkout -b my-fork-of-5.9-rc1 v5.9-rc1

Now, assuming that your original question indeed came from thinking
of a bundle like a patch and not like a repository, we have a
question for you.  What in

    $ git bundle --help

gave such an incorrect impression?  The documentation must be at
fault here, and we need to clarify so that future readers of it will
not be confused into the same misconception.

Thanks.

  parent reply	other threads:[~2020-09-18 15:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 11:13 Apply git bundle to source tree? Andreas Grünbacher
2020-09-18 14:02 ` Taylor Blau
2020-09-18 14:12   ` Andreas Grünbacher
2020-09-18 14:17     ` Taylor Blau
2020-09-18 14:50       ` Andreas Grünbacher
2020-09-18 15:21         ` Andreas Schwab
2020-09-18 15:32           ` Andreas Grünbacher
2020-09-18 15:52             ` Andreas Schwab
2020-09-18 15:41 ` Junio C Hamano [this message]
2020-09-18 20:00   ` Andreas Grünbacher
2020-09-18 20:18 ` Konstantin Ryabitsev
2020-09-18 21:45   ` Andreas Grünbacher
2020-09-19 12:06     ` Thomas Guyot-Sionnest
2020-09-19 19:28     ` brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqbli3nlda.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=andreas.gruenbacher@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).