Mercurial Queues Emulation for Git
What is Git-MQ?
Git-MQ is a suite of shell scripts which extend the capabilities of git itself, to support patch queue management, by emulating (a subset) of the features offered by the Mercurial Queues Extension, to users of the Mercurial Source Code Management System. It exhibits a modular structure, to facilitate integration with other software suites; in particular — but by no means restricted to this purpose — it has been developed to support the package building feature of the mingw-pkg suite, which was originally developed around the use of Mercurial for source code and patch management, for the convenience of users who may prefer to use git, rather than Mercurial, for this purpose.
Why Use Git-MQ?
If you've read the Mercurial Queues reference information, you may be wondering "why would I want to use Git-MQ?" Well, in the first place, I don't agree with the suggestion that tools such as rebase, and histedit, (or their git equivalents), are necessarily a better choice than mq — it very much depends on your ultimate objective, and mq is, by far, the better choice when the creation and management of patches is high on your priority list, (as it was for me). Secondly, the caveat about losing data is every bit as applicable to any method of rewriting history, as it may be to mq — in fact, in many years of using Mercurial Queues, I have never suffered any consequential data loss!
So, if you are comfortable with rebasing, and rewriting history, by all means continue to use those techniques. However, if management of patches is of interest to you, (e.g. as a constituent of a ports system), you may wish to consider Git-MQ; if nothing else, it offers a clean, consistent, user interface for the management of a patch series, within git.
Git-MQ Version 0.1.0, written by Keith Marshall Copyright (C) 2018, 2019, Keith Marshall The Git-MQ program suite is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation, either version 3 of the Licence, or (at your option) any later version. The Git-MQ program suite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for more details. You should have received a copy of the GNU General Public Licence along with this program. If not, see <https://www.gnu.org/licenses/>.
Git-MQ is designed as an extension for git itself, providing to git users, a suite of commands which closely mimic those provided to Mercurial users, by Mercurial's mq extension. Thus, where a Mercurial user might invoke the "hg qnew ..." command, a Git-MQ user would invoke the "git qnew ..." command.
In its present state of development, a substantially complete subset of Mercurial's mq commands are emulated in Git-MQ; those which are currently supported comprise:–
Git-MQ may be conveniently installed by selecting the git-mq-<version>-bin.tar.xz package, from the following list of released files, downloading, and unpacking it into your choice of installation <prefix> directory:
Once installed, and provided git is already installed, and <prefix>/bin is in $PATH, you may run any of the Git-MQ subcommands listed in the table, under Git-MQ Features, as if it were any regular git command; access to the documentation, (which requires a man-page reader), is provided by appending the --help option, or by running git help with the subcommand name as argument.
Alternatively, if you prefer to build, and install from source, you may download the git-mq-<version>-src.tar.xz package, unpack it into any working directory of your choice, then proceed as follows:
$ mkdir git-mq-<version>/build $ cd git-mq-<version>/build $ ../configure --prefix=<your-choice> $ make $ make install
Note that you may omit the --prefix=<your-choice> argument to configure; in this case, configure will choose /usr/local on your behalf, and you will likely need to run the make install step as a privileged user. (You may also need to do this, if --prefix=<your-choice> refers to a directory requiring privileged access rights).
Latest updated Tickets