git-generate

command
v0.0.0-...-a0ef209 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Git-generate regenerates a commit from a script kept in the commit message.

Specifically, the topmost commit in the current git repo should have a script preceded by [git-generate] on a line by itself. The script continues until the end of the message or a Change-Id: line. The script starts execution in the root of the git repo.

For example, a commit message might say:

We are moving from Old to New.

[git-generate]
cd some/dir
sed -i '' 's/Old/New/g' *

To regenerate the commit, git-generate resets the working file state to before the commit and then runs the script. The script runs using 'bash -e', so any single command failing will abort the generation.

When a merge conflict occurs while rebasing, git does not stop with the conflicting commit at the top, so git-generate will not find it by default. The -conflict flag tells git-generate to look for the script in the upcoming (conflicting) commit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL