Giter VIP home page Giter VIP logo

git-packaging-tools's Introduction

Packaging Tools

These are tools that help preparing/operating/modifying patches and .spec files during the tough life of packagers.

Patch remixer

So you are a package maintainer. As a first step, you use the whole OBS because you do not want to live in a stone age clinging rocks to get a fire. But as a next step, you aren't happy to use Quilt from back to 2003 (a bronze age, to be fair), so you want to be modern and keep all your patches in the Git repository, instead of directly inside your package.

But you quickly discover that Git has some limitations, which are preventing you from getting it right. Limitations are these:

  1. Naturally, Git creates patches with an order number: NNNN_commit_name.patch, so you know the order which patch after which. But the NNNN thing generates all the problems for you.

  2. After you renamed patches, you now need to keep track of their order inside your .spec file. It might work with 10-20 patches, but you will get lost if they are exceeding 20 and you need to "shuffle" them around, shifting their order during version update etc.

  3. In package terms, a commit to a Git is not always a patch. A patch may contain (and usually does) several commits. So every time you squash few commits into one patch and then rebase the whole thing, you usually do force-push. This is perfectly OK for tracking the patches in a dedicated Git repo. However force-push renders commit ID changing, while an actual code mostly do not change. The package changelog and its history, however, reflects this change, because it is a valid diff. So your package reviewer might see countless "changes" that aren't as such.

The git-format-pkg-patch tool is here to:

  1. Format patches from a specific range of commits or tags etc.
  2. Re-format them the way they are compatible with OBS change tracking policies
  3. Replace/update existing patches if necessary
  4. Generate an inclusion text file for .changes log
  5. Use those patches that actually makes sense to be replaced.

Alternative approaches

You may ask, if we want to avoid the bronze age, why use patches at all? Since instead we could just keep all the patches in Git, and then automatically generate tarballs directly from the head of a Git branch. And in fact there are also tools to help automate that, e.g.

One answer is that sometimes it is desired to take the sources from an official release tag as a tarball with an exact checksum, and then put patches on top of that.

Man pages & docs

Please read up to date man page.

Typical example

First, you create your patches somewhere within your Git project foo:

  1. mkdir -p /home/you/foo/patches
  2. git-format-pkg-patch -f TAG

Where TAG is your release tag (or commits range if you don't use tagging) in Git against which you are creating your set of patches.

Second (version A), assuming /home/you/foo/patches is accessible, so you go to your OBS project and update the patches with it:

  1. cd /home/you/obs/project
  2. git-format-pkg-patch -u /home/you/foo/patches

It will report you what was added/changed/removed and will generate a text file patches.changes.txt in the same directory, which you can reuse to include its content into .changes log of the package.

Second (version B), you do the same as above, except add option -c during the next step like this:

git-format-pkg-patch -u /home/you/foo/patches -c

This will do the same as above, but will actually update the contents of those files.

git-packaging-tools's People

Contributors

brejoc avatar isbm avatar meaksh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.