Command line interface

git-gq : handle git patch queues

usage: git gq COMMAND [OPTIONS]

Bash completion commands

commands

List all known commands on the console

bashcompletion

List the line you have to add to your .bashrc to integrate completion into the ‘git’ command.

Queue management commands

init [QNAME [REV]]

Create/select a patch queue with name ‘QNAME’. QNAME is optional, the default patch queue name is ‘default’. If ‘REV’ is given this is the parent revision, if it is not givem, ‘HEAD’ is taken as the parent. You must run this command once to initialize the patch queue in your repository.

qname [QNAME]

If QNAME is not given, show current patch queue name. if QNAME is given, change to patch queue QNAME. If the patch queue QNAME is created for the first time, the parent revision is set to your ‘HEAD’ revision. If this is not intended, you may change this with git gq parent REVISION to another revision.

backup

Create backup tar file of patch directory ‘.gqpatches’.

restore FILE

Restore patch directory from a backup file. ‘.gqpatches’.

change-order

Call an editor to edit the file that contains all currently unapplied patches. Note the the patches in the file are applied from top to bottom.

applied

Show all applied patches up to parent+1.

unapplied

Show all patches of the patch queue.

parent [REVISION}

Set REVISION as patch queue parent revision. Do never go beyond this revision with pop. Use ‘HEAD’ to set your repository HEAD as parent revision. If HEAD is not given, show the current parent revision.

export DIRECTORY

Create numbered patch files from all currently applied patches in DIRECTORY. The numbers are in the order of patches from bottom to top. DIRECTORY must exist.

import PATCHFILE [PATCHFILE…]

Import a number of patchfiles to the patch queue. The last patchfile in the list will be on the top of the queue. Note that the patch files must have been generated with git format-patch or git gq pop. This cannot be used for patches generated with the patch program. These you have to apply with git apply PATCHFILE.

Patch management commands

new [NAME]

Create new patch (commit) with log-message NAME. NAME is meant as a preliminary commit message, it should be a single line without spaces. If NAME is omitted, you can enter a complete log message interactively.

record [NAME]

Interactively select changes for a new patch (commit with log-message NAME)

refresh

Update the topmost patch.

pop

Pop the topmost patch.

push

Apply the top patch from the patch queue.

goto NAME|REGEXP

Do push or pop until the specified patch is the latest applied patch.

fold NAME|REGEXP

Fold patch ‘NAME’ to the topmost patch. Patch ‘NAME’ must not be appled already. Note that the log message of the fold-patch is appended to the existing log message. You may change the log message with git gq refresh -e.

delete NAME|REGEXP

Delete unapplied patch with given name.

show NAME|REGEXP

Show changes of an applied or unapplied patch on the console.

continue

Continue ‘push’ after you had a conflict and had it fixed manually.

abort

Abort (undo) ‘push’ after you had a conflict and could not fix it manually.

Miscellaneous commands

help

Show this help.

doc

Show reStructuredText source of man page.

man

Show man page.

glog

Graphical log, display all commits and branches as a tree on the console.

OPTIONS

-h –help

Show help.

-H –HELP

Show help without pager.

-v –version

Show version and exit.

-D –debug

Run the script with “set -x” which shows what it does.

-a –all

push/pop: apply on ALL patches.

-N –no-add

new/refresh/fold: DO NOT add all modified changes to patch. continue: DO NOT add all modified and unknown changes to patch

-e –edit

refresh/fold: start editor to edit log message

-m –message MESSAGE

refresh: use MESSAGE as log message

-F –file FILE

refresh: take log message from FILE.

-L –full

restore: do also restore all patches that were applied when the backup was created. Caution: This runs git checkout PARENT and git am on your repository.