0

I am in the following situation:

  1. There's an Open Source Project (AT91B) maintained under git, doing regular Releases.
  2. At release 3.7.0 this project is cloned by ACME and modified.
  3. AT91B is updated and does more releases
  4. ACME does NOT actively track AT91B.
  5. Now AT91B is at 3.7.1
  6. I have access (I can "git clone") to both git repos.

What I need is a patch (or a set of patches, if necessary) to apply to AT91B-3.7.1 tarball to integrate ACME changes (consisting of several new files and some minor tweak to the existing ones).

I understand this should be fairly standard git stuff (I do not know git very well, just basic stuff; merging is still out of my radar, but I guess I'll have to learn). Problem is I need to work with tarballs(original releases) + patches(homebuilt, if needed).

How do I produce such a patch [set]?

UPDATE:

I tried using git format-patch -M -B -C -k --stdout refs/remotes/origin/at91bootstrap-3.x >my.patch, but this is no good because it produces multiple entries for each file (apparently one for each commit) and then patch usage results in multiple rejects (IIRC only the first succeds).

How do I "flatten" the patches?

ZioByte
  • 2,690
  • 1
  • 32
  • 68
  • 1
    If both the upstream project and ACME's clone is managed with git, why would you want to bother with patches and tarballs? You're saying "I need to work with tarballs ..." but is this a limitation you've decided on because you don't understand merges? – Magnus Bäck Feb 20 '15 at 10:58
  • @MagnusBäck: No, the package is actually inserted into a larger build system (buildroot) which will fetch tarballs and, optionally, patch them; AFAIK it has no provision for git-cloning, hence the need. – ZioByte Feb 20 '15 at 11:16
  • You should be able to flatten the patches by creating a local branch, in which you _squash_ the commits into a single commit, and then creating the patches off that branch. – nwinkler Feb 20 '15 at 12:32

1 Answers1

0

For the record: It's much simpler than expected. I really don't understand why it was so difficoult to dig out the info (MANY thanks to @Rob Di Marco (see: https://stackoverflow.com/a/616851/1714490).

Solution is to use "git diff"; in my case:

git diff -M -B -C refs/remotes/origin/at91bootstrap-3.x >whatever.patch

Of course then You will have to handle any conflict, but that's standard procedure.

Community
  • 1
  • 1
ZioByte
  • 2,690
  • 1
  • 32
  • 68