From 234450c888f1345c4bfbfc326d84ebb3b5cf6080 Mon Sep 17 00:00:00 2001 From: Blair Conrad Date: Wed, 12 Feb 2025 12:26:29 -0500 Subject: [PATCH] Rename git-absorb.txt to git-absorb.adoc GitHub will render the adoc file as a document, which is more readable than the plain text file. --- .github/workflows/release.yml | 2 +- Documentation/Makefile | 4 +- Documentation/README.md | 2 +- .../{git-absorb.txt => git-absorb.adoc} | 0 README.md | 58 +------------------ 5 files changed, 7 insertions(+), 59 deletions(-) rename Documentation/{git-absorb.txt => git-absorb.adoc} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe91ea0..0e13ef4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -162,7 +162,7 @@ jobs: mkdir -p "$staging"/doc cp {README.md,LICENSE.md} "$staging/" - cp Documentation/{git-absorb.1,git-absorb.txt} "$staging/doc/" + cp Documentation/{git-absorb.1,git-absorb.adoc} "$staging/doc/" if [[ "${{ matrix.target }}" =~ .*windows.* ]]; then cp "target/${{ matrix.target }}/release/git-absorb.exe" "$staging/" diff --git a/Documentation/Makefile b/Documentation/Makefile index d140be9..3056326 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,9 +1,9 @@ build-manpage: git-absorb.1 -git-absorb.1: git-absorb.txt +git-absorb.1: git-absorb.adoc $(if $(shell which a2x),,$(error "No a2x in PATH; install asciidoc.")) $(info Building manpage. This may take a few moments...) - a2x -L -d manpage -f manpage git-absorb.txt --attribute man-version=${GA_VERSION} + a2x -L -d manpage -f manpage git-absorb.adoc --attribute man-version=${GA_VERSION} clean: rm -f git-absorb.1 git-absorb.xml diff --git a/Documentation/README.md b/Documentation/README.md index 88d6ea7..5e3b9b3 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -1,7 +1,7 @@ git-absorb manual ================= -This project's man page `git-absorb.1` can be generated from `git-absorb.txt` +This project's man page `git-absorb.1` can be generated from `git-absorb.adoc` by running `make`. Build dependencies diff --git a/Documentation/git-absorb.txt b/Documentation/git-absorb.adoc similarity index 100% rename from Documentation/git-absorb.txt rename to Documentation/git-absorb.adoc diff --git a/README.md b/README.md index 2fa21ad..a8ad3b2 100644 --- a/README.md +++ b/README.md @@ -93,63 +93,11 @@ Note: `cargo install` does not currently know how to install manpages ([cargo#27 For each hunk in the index, `git absorb` will check if that hunk commutes with the last commit, then the one before that, etc. When it finds a commit that does not commute with the hunk, it infers that this is the right parent commit for this change, and the hunk is turned into a fixup commit. If the hunk commutes with all commits in the range, it means we have not found a suitable parent commit for this change; a warning is displayed, and this hunk remains uncommitted in the index. -## Configuration +## Documentation -### Stack size +For additional information about git-absorb, including all arguments and configuration options, see [Documentation/git-absorb.adoc](Documentation/git-absorb.adoc), +or the git-absorb manual page. -When run without `--base`, git-absorb will only search for candidate commits to fixup within a certain range (by default 10). If you get an error like this: - -``` -WARN stack limit reached, limit: 10 -``` - -edit your local or global `.gitconfig` and add the following section - -```ini -[absorb] - maxStack=50 # Or any other reasonable value for your project -``` - -### Generate fixups for commits not authored by you - -By default, git-absorb will only generate fixup commits for commits that were authored by you. -Instead, use the `--force-author` flag to generate fixup commits for commits written by any author. -To always have this behavior, set - -```ini -[absorb] - forceAuthor = true -``` - -### One fixup per fixable commit - -By default, git-absorb will generate separate fixup commits for every absorbable hunk. Instead, can use the `-F` flag to create only 1 fixup commit for all hunks that absorb into the same commit. -To always have this behavior, set - -```ini -[absorb] - oneFixupPerCommit = true -``` - -### Auto-stage all changes if nothing staged - -By default, git-absorb will only consider files that you've staged to the index via `git add`. However, sometimes one wants to try and absorb from all changes, which would require to stage them first via `git add .`. To avoid this extra step, set - -```ini -[absorb] - autoStageIfNothingStaged = true -``` - -which tells git-absorb, when no changes are staged, to auto-stage them all, create fixup commits where possible, and unstage remaining changes from the index. - -### Fixup target always SHA - -By default, git-absorb will create fixup commits with their messages pointing to the target commit's summary, and if there are duplicate summaries, will fall back to pointing to the target's SHA. Instead, can always point to the target's SHA via: - -```ini -[absorb] - fixupTargetAlwaysSHA = true -``` ## TODO