Compare commits

...

141 commits
7.0.0 ... main

Author SHA1 Message Date
dependabot[bot] 4cf28ec559
chore(deps): bump actions/stale from 10 to 11 (#1265)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / Test with Bats (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
Signed-off-by: dependabot[bot] <support@github.com>
2026-09-01 12:25:44 -07:00
罗泽轩 09b77e8ed6
ci: add generated manuals check (#1268)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / Test with Bats (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2026-08-27 13:59:29 +08:00
Vijay Misal 4c38988ba9
feat(mr): support Forgejo/Codeberg pull request URLs (#1267)
* feat(mr): support Forgejo/Codeberg pull request URLs

Codeberg and other Forgejo instances expose pull requests under
refs/pull/<id>/head instead of GitLab's refs/merge-requests/<id>/head,
so passing a Codeberg pull request URL to git mr fetched the wrong
ref. Recognize the /pulls/<id> URL shape and switch to the matching
ref for that case, leaving the GitLab URL and bare numeric id
behavior unchanged.

Closes #1213

* test(git-mr): cover Forgejo/Codeberg URLs, regenerate man docs

Add a bats test that exercises the pulls URL branch via a local
insteadOf remote rewrite (no real HTTP endpoint needed), and bring
git-mr.1/git-mr.html in line with the git-mr.md changes.

---------

Co-authored-by: vjymisal0 <vijay.looprai@gmail.com>
2026-08-27 13:59:00 +08:00
Vijay Misal dbf68bac59
fix(is-git-repo): recognize bare repositories (#1266)
* fix(is-git-repo): recognize bare repositories

is_git_repo() used `git rev-parse --show-toplevel` to detect whether
the current directory is inside a git repository. --show-toplevel
fails for bare repositories since they have no working tree, so every
command that relies on this shared helper (e.g. `git browse`) reports
"Not a git repo!" when run from inside a bare repo, even though it
plainly is one.

Switch to `git rev-parse --git-dir`, which succeeds for both normal
and bare repositories and keeps the existing "not a repo" behavior
for non-repo directories.

Fixes #1238, reported and LGTM'd by maintainers there with this exact
fix; no PR had been opened for it yet.

Adds tests/is-git-repo.bats covering: a normal repo, a bare repo, and
a plain (non-repo) directory.

* Fix ruff lint failures in scripts/checkstyle.py

This PR's new Ruff CI job surfaced pre-existing style issues (unsorted
imports, deprecated typing.List/Dict, nested ifs, bare exit()) in
checkstyle.py. Cleaned these up so the newly added lint job passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 14:15:48 +08:00
dependabot[bot] 03569856db
chore(deps): bump actions/setup-python from 6 to 7 (#1263)
* chore(deps): bump actions/setup-python from 6 to 7

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix lints

* Fix typo

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
Co-authored-by: spacewander <spacewanderlzx@gmail.com>
2026-08-14 12:27:16 +08:00
罗泽轩 d11e45f0b1
port python tests to bats (#1264)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2026-08-12 15:43:59 +08:00
dependabot[bot] fd2e03cf55
chore(deps): bump actions/setup-go from 6 to 7 (#1262)
Signed-off-by: dependabot[bot] <support@github.com>
2026-07-19 18:52:47 -07:00
AJ Côté 5a14757944
feat(scp): add verbose, interactive, and dry-run flags (#1261)
* feat(scp): add -v/--verbose and -i/--interactive flags

git scp/git rscp printed a diff via plain `git diff`/`git diff --stat`
with no `--no-pager` and no TTY check, blocking on the user's pager.
Add -v/--verbose to print the diff via --no-pager before syncing, and
-i/--interactive to also prompt for confirmation before the real
push/copy. Both apply to git scp and git rscp, and must precede
<remote>.

Updates man/git-scp.md and Commands.md.

* feat(scp): add -n/--dry-run flag

Add -n/--dry-run to preview a sync without changing anything: rsync
runs with -n, and git add --force / ssh ... rm are skipped outright.
Implies --verbose, since confirming or previewing with nothing shown
is useless.

Also restructures scp_and_stage's push/delete blocks from `&&`-chains
into if/then, needed to branch on dry-run, which incidentally fixes a
latent bug where a non-TTY COLOR_RESET could silently skip the real
rsync/git add/ssh rm calls.

Updates man/git-scp.md and Commands.md.

* test(scp): add coverage for -n/--dry-run and -i/--interactive abort

git-scp had no test coverage at all. Cover the two paths that need no
real remote destination: dry-run must preview without touching the
index, working tree, or remote path, and declining the interactive
confirmation must abort before anything syncs.

* feat(scp): Code review

* feat(scp): Code review
2026-07-14 19:43:00 +08:00
kdergachev b450b36036
Added edit/remove functionality to git-ignore (#1258)
* Added edit/remove functionality to git-ignore.

* Minor change to array-string assignment.

* Fixes array handling for remove.

* Suggested fixes (iteration over arguments, pattern removal, editor handling, tmp file location, symlinked gitignore handling).

* Changed pure bash editing of files to an awk script. Some other minor cosmetic changes.

* Updated docs.

* Modified autocomplete to work with new git-ignore

* Added help message to git-ignore.

* Added help flags to git-ignore's man.

* Made $file in eval safe. Should not do the same for editor since then all of the GIT_EDITOR will be treated as command (flags included).

* Typo fixes.
2026-07-14 19:42:02 +08:00
Acho Arnold 7f36d37283
fix: support Windows ARM64 (clangarm64) in install.cmd (#1259)
Some checks failed
ci / Test with Bats (push) Has been cancelled
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / Test with Pytest (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* fix: support Windows ARM64 (clangarm64) in install.cmd

Git for Windows on ARM64 uses a `clangarm64` directory instead of
`mingw64`. The installer now auto-detects `clangarm64` when
`mingw64` is not present, so it works out of the box on ARM64
Windows machines without requiring the user to manually supply
the path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: remove trailing whitespace from install.cmd

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: correctly resolve PREFIX when git.exe is under the arch dir in PATH

When 'where git.exe' resolves to ...\mingw64\bin\git.exe or
...\clangarm64\bin\git.exe, installdir becomes the architecture directory
itself. Detect that case by inspecting the leaf directory name instead of
appending mingw64/clangarm64 (which produced non-existent ...\mingw64\mingw64
paths) or using ..\ segments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-08 15:20:25 +08:00
dependabot[bot] 184d37e980
chore(deps): bump actions/checkout from 6 to 7 (#1260)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / Test with Pytest (push) Has been cancelled
ci / Test with Bats (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-22 14:05:50 +08:00
Utsav Sabharwal e92878b81b
feat: add git-delete-gone-branches command (#1239)
* feat: add git-delete-gone-branches command

Adds a new command to delete local branches whose remote-tracking
branch has been deleted (shown as [gone] in git branch -vv).

This is a common need after PRs are merged and remote branches are
cleaned up, leaving stale local branches behind.

Features:
- Deletes all local branches with a gone remote in one command
- --dry-run / -n flag to preview branches before deletion

Closes #1220

* Address PR review feedback on git-delete-gone-branches

- Use git for-each-ref instead of git branch -vv to avoid false
  positives from commit messages containing ': gone]'
- Add interactive confirmation prompt by default; skip with -f/--force
- Add -p/--prune flag to run git fetch --prune before checking
- Add generated man page .1 and .html files

* Use GitHub profile for author contact in man page

* Fix gone-branch detection with nobracket format
2026-06-09 10:36:27 +08:00
罗泽轩 b9e1d88f2c
doc: regenerate git-extras.1 (#1255)
This file has been reset since commit 032090e847

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2026-05-26 12:28:42 +08:00
Ricardo Fernández Serrata 99207eee8e
refactor(delete-merged-branches): rm -n1 from xargs, fmt pipes (#1233) 2026-05-18 16:10:46 +08:00
罗泽轩 9d6319becb
Bump git-extras version to 7.6.0-dev (#1251) 2026-05-11 09:49:38 +08:00
罗泽轩 2bdeb59a73
Version 7.5.0 (#1250)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2026-05-10 10:19:14 +08:00
Russ c5a0fdf660
Use standard prefix for home dir installs (#1248) 2026-04-29 13:46:32 -07:00
Ricardo Fernández Serrata 8d1c970031
refactor(abort): common gitdir (#1244)
* refactor(abort): common gitdir

* un-readonly
2026-04-14 13:26:28 +08:00
罗泽轩 c06fad59d2
Fix man page usage docs (#1241) 2026-03-23 23:21:26 -07:00
phanium 65dd36ae62
Fix git-changelog to handle whitespace in command arguments (#1232) 2026-03-05 23:06:10 -08:00
dependabot[bot] 967e339f91
chore(deps): bump bats-core/bats-action from 3.0.1 to 4.0.0 (#1230)
Bumps [bats-core/bats-action](https://github.com/bats-core/bats-action) from 3.0.1 to 4.0.0.
- [Release notes](https://github.com/bats-core/bats-action/releases)
- [Commits](https://github.com/bats-core/bats-action/compare/3.0.1...4.0.0)

---
updated-dependencies:
- dependency-name: bats-core/bats-action
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 14:36:15 +08:00
罗泽轩 ae3d30fb6e
add details when multiple active operations found (#1229)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2026-02-06 15:03:50 +08:00
John Bachir 032090e847
Add persistent history to git-repl (#1226)
* persistent command history

* notes

* decision on which commands to save

* configurable history location

* fix history initialization in various scenarios

* documentation

* comment

* don't add whitespace or consecutive duplicates to history

* fix manpage output

* Update bin/git-repl

Co-authored-by: Edwin Kofler <edwin@kofler.dev>

* Update bin/git-repl

Co-authored-by: Edwin Kofler <edwin@kofler.dev>

* Update git-repl

* Update bin/git-repl

* Apply suggestions from code review

* Add `extglob` and generate docs

* Fix regex

* update docs

rm man/git-repl.{1,html}
touch man/git-repl.md
make man/git-repl.{1,html}

---------

Co-authored-by: Edwin Kofler <edwin@kofler.dev>
2026-02-05 11:05:01 -08:00
Erik Skultety 5367101f2e
Support passing ref to git-commits-since (#1228) 2026-02-02 21:39:48 -08:00
John Bachir 6ed2643252
ability to specify command when hitting enter (#1223)
* ability to specify command when hitting enter

* documentation

* man page

* generate man page and html

* run default command through same logic as other commands

impetuous: persist return val for display in promt if non-zero

also future-proofs for other benefits / DRYness. no need for another eval invocation.

* fix generated manpage
2026-01-20 14:11:45 +08:00
John Bachir b9bd309a87
Improve git-repl prompt (#1224)
* repl config ideas

* documentation

* Update bin/git-repl

Co-authored-by: Edwin Kofler <edwin@kofler.dev>

* separator

* man page and web docs

* always use dir for project name

---------

Co-authored-by: Edwin Kofler <edwin@kofler.dev>
2026-01-19 16:15:42 -08:00
johnpyp 6f4cf0c1bb
feat: delete-branch multiple unique branch names completions (#1221) 2025-12-18 12:40:24 -08:00
dependabot[bot] f5c48e4842
chore(deps): bump actions/checkout from 5 to 6 (#1219)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 10:42:06 +08:00
Hugo Ruiz-Mireles daf9d4148e
Made Git Magic use --force-with-lease (#1218)
This change simply overwrites the usage of `-f` with
`--force-with-lease` in git-magic because `--force-with-lease` is a
safer alternative.
2025-10-22 11:49:27 +08:00
dependabot[bot] eb34655aea
chore(deps): bump actions/stale from 9 to 10 (#1214)
Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v9...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-08 10:29:50 +08:00
dependabot[bot] 1f1320f4d6
chore(deps): bump actions/setup-go from 5 to 6 (#1215)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-08 10:29:28 +08:00
dependabot[bot] 4d05955bc5
chore(deps): bump actions/setup-python from 5 to 6 (#1216)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-08 10:28:51 +08:00
Daniele Paolella b57eb8b92a
Fix minor typo in git rename-branch man page (#1211)
* docs: fix symbols in `git rename-branch` man page

* Format doc page after others and rebuild artifacts
2025-09-04 10:51:48 +08:00
Daniele Paolella cf6d40d446
Improvements to Bash completion (#1210)
* Sort Bash completion functions

* feat: add Bash completion for `git rename-branch`

* feat: add Bash completion for `git rename-remote`

* feat: add Bash completion for `git rename-tag`

* fix: use default completion for `git rename-file`

* Refactor rename completion functions common logic
2025-08-29 18:29:31 +08:00
Edwin Kofler 14586c7da0
Fix use of git-whatchanged to git-log (#1212) 2025-08-29 18:27:55 +08:00
dependabot[bot] 5c9a7a2533
chore(deps): bump actions/checkout from 4 to 5 (#1209)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-18 11:15:38 +08:00
罗泽轩 215382b12d
Bump version to 7.5.0-dev (#1207)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2025-06-23 11:08:27 +08:00
罗泽轩 13cbdfc51e
Version 7.4.0 (#1206)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2025-06-20 11:12:58 +08:00
Edwin Kofler 3ddc315a76
Format comparisons, functions, and redirections to be consistent (#1201)
* Format comparisons and functions to be consistent

* Add `checkstyle.py` script and add check to CI

* Fix Ruff lints
2025-06-06 11:10:50 +08:00
Andrew Sullivan Cant c63b46a33b
add git-wip and git-unwip (#669)
* Upgrade codespell to v2.4.0

It is a lastet verison, and is needed so that I can use the inline
ignore support in a future commit.

After updating tests/pyproject.toml I ran the following commands:
```
cd tests
poetry lock --no-update
poetry install
```

I also fixed a spelling error in man/git-summary.md, which was not
caught by the old version of codespell. After updating the file I also
updated the related files by running the following commands:

```
cd man
make -C .. man/git-summary.{1,html}
```

* add git-wip and git-unwip

Updated/re-built the documentation with:
```
cd man
make -C .. man/git-unwip.{1,html}
make -C .. man/git-wip.{1,html}
make -C .. man/git-extras.{1,html}
```
2025-05-14 17:05:41 +08:00
dependabot[bot] d4cd272556
Merge pull request #1203 from tj/dependabot/github_actions/bats-core/bats-action-3.0.1 2025-03-31 05:00:48 +00:00
dependabot[bot] 783812b627
chore(deps): bump bats-core/bats-action from 3.0.0 to 3.0.1
Bumps [bats-core/bats-action](https://github.com/bats-core/bats-action) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/bats-core/bats-action/releases)
- [Commits](https://github.com/bats-core/bats-action/compare/3.0.0...3.0.1)

---
updated-dependencies:
- dependency-name: bats-core/bats-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-31 00:23:42 +00:00
Edwin Kofler c49ca70814
Mostly finish pytest to Bats conversion (#1200)
* Mostly finish pytest to Bats conversion

* Add Bats version note to testing docs

* Move Bats CI check to separate job
2025-03-26 11:19:30 +08:00
Edwin Kofler 18ecffef5e
Implement half of tests in Bats (#1187)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* Initial scaffold

* Finish first half of Bats tests

* Add Bats to CI

* Fix CI

* Fix CI

* Fix configuration to set git name and email

* Fix `GIT_CONFIG_{KEY,VALUE}` indexing

* Fix Git config override precedence

* Remove unused and untested function
2025-03-12 18:15:37 +08:00
Edwin Kofler aadf5f874b
Add stale bot for old PRs (#1186)
* Add stale bot for old PRs

* Update message

* Update .github/workflows/stale.yaml

Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>

* Fix stale workflow

* Update .github/workflows/stale.yaml

Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>

---------

Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
2025-03-12 18:14:53 +08:00
Pierre Ayoub 18d1017325
feat(git-bulk): add new option to not follow hidden directories (#1195)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* feat(git-bulk): add --no-follow-hidden flag

* docs(git-bulk): add --no-follow-hidden description

* docs(man): make ronn

* docs(git-bulk): put --no-follow-hidden at right place in usage()

* refactor(git-bulk): logic optimization

Remove unnecessary subshell

Co-authored-by: Edwin Kofler <edwin@kofler.dev>

* fix(git-bulk): bad test operator

With the Bash' regexp matching operator `=~`, we need to use the Bash
conditional expression evaluation command `[[ ]]`.

* docs(completion.zsh): add --no-follow-hidden and --no-follow-symlink

---------

Co-authored-by: Pierre Ayoub <pierre.ayoub@protonmail.com>
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
2025-03-05 10:39:41 +08:00
Pierre Ayoub a841845d9a
Feat: allow git-summary showing full path of repository (#1193)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* feat(git-summary): add --full-path option

* docs(git-summary): add doc for --full-path option

* docs(man): make using ronn

* docs(git-extras-completion.zsh): add --full-path option of git-summary
2025-02-27 14:25:55 +08:00
Pierre Ayoub 8eed5f49ad
feat(git-bulk): add new option to no follow symlinks (#1194)
* feat(git-bulk): add --no-follow-symlinks flag

* docs(git-bulk): add --no-follow-symlinks description

* docs(man): make ronn

* docs(git-bulk): put --no-follow-symlinks at right place in usage()

* fix(git-bulk): use readarray for find command

1. Use `readarray` such that we can handle paths with spaces
2. Remove the unnecessary `eval`
2025-02-27 14:18:16 +08:00
Pierre Ayoub 64687599ae
docs(git-bulk): Add zsh completion (#1190)
* docs(git-bulk): Add zsh completion

* docs(git-bulk): Harmonize help strings

* docs(git-bulk): simplify previous bad logic

The previous logic was not allowing to use multiple options (which is
often the case). This was bad because this is my first time with zsh
automcompletion. Without it, the user can use any flag combination --
but at least, he has the freedom.
2025-02-26 12:34:04 +08:00
Pierre Ayoub 8ce63003c0
fix(git-bulk): fix workspace selection when cd fails (#1197)
* fix(git-bulk): fix workspace selection when cd fails

`cd` may fails for multiple reasons:
- mistake when editing `.gitconfig` manually
- previously existing workspace that have been removed
- ...

Currently, if `cd` fails, the `BulkOp` continue its execution ... in the
workspace defined in a higher directory that where the user, despite the
user specified a specific workspace (`-w`).

The user should be noticed of a failed `cd` (this is really not expected
for a valid configuration) and the operations should stop to not execute
something unexpected.

* fix(git-bulk): replace weak eval for better variable substitution

Get rid of poor `eval` syntax because they are vulnerable to command
injection, which may have unexpected side effects.

However, they enabled a useful feature: using environment variable
(*e.g.*, defined in a `.bashrc`) inside the `.gitconfig` to use dynamic
paths as  `bulk` workspaces.

As such, I keep this feature possible by using the Bash's ${!VAR}
syntax, which allows to get the value of one variable using the name of
a another variable. However, arbitrary command injection is not possible
anymore.

* fix(git-bulk): missing check about empty environnement variable

* style(git-bulk): typo

* docs(Commands.md): git-bulk env var feature

* docs(man/git-bulk): git-bulk env var feature

* docs(man/git-bulk): mention .gitconfig for config storage

* style(man/git-bulk): typo

* docs(man/git-bulk): run make/ronn for .1 and .html
2025-02-26 12:33:16 +08:00
Pierre Ayoub 1a9b0c2ab4
fix(git-bulk): quiet find errors by default (#1196)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2025-02-20 15:47:27 +08:00
Pierre Ayoub 82cc37d0f5
fix(git-bulk): fix a bad integer expression (#1198)
Fix a logic error inside the `allowedargcount()` function. This function
may be called with one or two arguments. However, no default values are
assigned to `$1` and `$2` that are used inside a numerical comparison.
Therefore, when using a bad number of arguments for the following lines:

```
listall|purge) allowedargcount 1;;
addcurrent|removeworkspace) allowedargcount 2;;
```

Then, we would get the error `[: : integer expression expected`. To fix
this, we assign the 0 default value to `$1` and `$2`, such that we
trigger the error message destined to the user without any integer error
when there is a bad number of argument and that the function is called
with only 1 argument instead of 2.
2025-02-20 15:41:42 +08:00
dependabot[bot] df53711fc7
chore(deps): bump astral-sh/ruff-action from 2 to 3 (#1189)
Some checks failed
ci / test (push) Has been cancelled
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
Bumps [astral-sh/ruff-action](https://github.com/astral-sh/ruff-action) from 2 to 3.
- [Release notes](https://github.com/astral-sh/ruff-action/releases)
- [Commits](https://github.com/astral-sh/ruff-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: astral-sh/ruff-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-29 18:13:50 -08:00
oikarinen e691826b4b
Fix all ShellCheck errors and add to CI (#1179)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-12-20 23:16:39 -08:00
dependabot[bot] fdaca2cd26
chore(deps): bump astral-sh/ruff-action from 1 to 2 (#1188)
Some checks failed
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
ci / lint (push) Has been cancelled
Bumps [astral-sh/ruff-action](https://github.com/astral-sh/ruff-action) from 1 to 2.
- [Release notes](https://github.com/astral-sh/ruff-action/releases)
- [Commits](https://github.com/astral-sh/ruff-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: astral-sh/ruff-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-02 10:06:50 +08:00
oikarinen 3db275cbe2
fix(ci): use poetry (#1183)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
For managing the python dependencies, running the unit tests and
spellchecker. This makes it easier for everyone to have same environment
as CI. Also includes few cosmetic edits for style for the ci.yml
2024-11-29 10:39:42 +08:00
Edwin Kofler 1345c5977d
Delete etc/test.fish (#1185) 2024-11-29 10:39:09 +08:00
oikarinen 2f4b57d52b
feat: add git-continue (#1176)
Some checks are pending
ci / lint (push) Waiting to run
ci / typo (push) Waiting to run
ci / test (push) Waiting to run
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-latest) (push) Waiting to run
* feat: add git-continue

Also refactor `git-abort` to parse action from the called file name.

There's a promise for this in #865 but that was a long time ago.

* fix: add git-continue

address review comments, fix the script, remove unnecessary testpath
import.
2024-11-28 16:50:29 +08:00
oikarinen c23da8ae9c
feat: add ruff linter with ci check (#1182)
Some checks are pending
ci / lint (push) Waiting to run
ci / typo (push) Waiting to run
ci / test (push) Waiting to run
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-latest) (push) Waiting to run
* feat: add ruff linter with ci check

Liniting the python files in tests directory would reduce whitespace etc
change and enforce basic coding standard for those. Kind of
opportunistic PR as there might be other opinions about how to deal with
this.

* fix: format with ruff
2024-11-28 10:30:14 +08:00
oikarinen f1f50ac5ba
fix(ci): missing dollar sign (#1184)
Some checks are pending
ci / lint (push) Waiting to run
ci / typo (push) Waiting to run
ci / test (push) Waiting to run
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-latest) (push) Waiting to run
Let's get the ci fixed!
2024-11-27 08:40:33 -08:00
oikarinen 0989b773de
fix(github-actions): changed files output for editorcondig-checker (#1180)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* fix(github-actions): changed files output for editorcondig-checker

Seems that ci.yml includes a dead dependency action just to get list of
changed files for the PR / push. This seems weird as the repo is all
about git. Propose removing this extra dep with straightforward
implemenation. Also: github runners do have `jq` preinstalled.

* feat(ci): print changed files to log in lint job
2024-11-26 11:53:50 +08:00
罗泽轩 65203312c1
Revert "feat: add ruff linter with ci check (#1178)" (#1181)
Some checks are pending
ci / lint (push) Waiting to run
ci / typo (push) Waiting to run
ci / test (push) Waiting to run
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-latest) (push) Waiting to run
This reverts commit a2c424aada.
2024-11-25 14:32:54 +08:00
oikarinen a2c424aada
feat: add ruff linter with ci check (#1178)
Some checks are pending
ci / lint (push) Waiting to run
ci / typo (push) Waiting to run
ci / test (push) Waiting to run
ci / build (macos-latest) (push) Waiting to run
ci / build (ubuntu-latest) (push) Waiting to run
* feat: add ruff linter with ci check

Liniting the python files in tests directory would reduce whitespace etc
change and enforce basic coding standard for those. Kind of
opportunistic PR as there might be other opinions about how to deal with
this.

* fix: format with ruff
2024-11-25 10:14:37 +08:00
Guilhem Saurel d291b2775c
Support GITHUB_TOKEN var for git-fork and git-pull-request (#1177)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
Co-authored-by: 罗泽轩 <4161644+spacewander@users.noreply.github.com>
2024-11-16 10:33:26 -08:00
罗泽轩 fb0bc6950b
Bump version to 7.4.0-dev (#1175)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2024-10-22 10:07:46 +08:00
罗泽轩 21a086c009
Version 7.3.0 (#1174)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2024-10-20 18:16:23 +08:00
Jared Baur 8eb1d72f07
Fix stripping trailing forward slash for git-get (#1172)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-10-18 10:22:05 +08:00
Mattias Andersson 233686d2a2
Change git-cp to use cleaner branch approach (#1169)
Some checks failed
ci / test (push) Has been cancelled
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* Change git-cp to use cleaner branch approach, per https://stackoverflow.com/a/46484848/32841 and https://devblogs.microsoft.com/oldnewthing/20190919-00/?p=102904

* Name the temporary branch to better fit in with git-extras

* Again, git-extras naming is "copy", not "split"

* Make the commit messages more clear
2024-10-08 11:40:43 +08:00
Edwin Kofler 5c3fb1b062
Improve warning for git clear (#1168)
Some checks failed
ci / test (push) Has been cancelled
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-09-30 10:07:52 +08:00
wyattscarpenter 5ca9360109
Enhance git-repl (#1160)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-09-22 20:22:58 -07:00
wyattscarpenter 16d1445271
Update some documentation that was out of sync (#1164)
Some checks are pending
ci / build (ubuntu-latest) (push) Waiting to run
ci / typo (push) Waiting to run
ci / test (push) Waiting to run
ci / lint (push) Waiting to run
ci / build (macos-latest) (push) Waiting to run
* make instructions easier to copy-paste

* update some documentation that was out of sync
2024-09-22 14:11:31 +08:00
wyattscarpenter 4d2d393142
Use filetimes in check_integrity (#1162)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* check the file times in check_integrity

* make no-arguments to check_integrity check all commands, and also make check_integrity run git-utimes first

this has the downside that the script now takes a little longer. But the upside that it guarantees more correctness.

* update git-extras

using the incredible power of the new script, I have detected this was out of date, out of sync, etc
2024-09-19 11:27:11 +08:00
wyattscarpenter ffee88a246
Update git-alias.md: add brs to prevent incorrect line behavior (#1161)
* Update git-alias.md: add brs to prevent incorrect line behavior

currently these all appear on one line, in the rendered markdown viewer and also in the man page. That isn't what's wanted. What's wanted is for each to be on its own line, which this change implements, using the strategy I found in git-bulk.

* run make on git-alias
2024-09-19 11:19:48 +08:00
wyattscarpenter da03b7b133
Update git-bulk.md: use correct stylization in synopsis (#1163)
* Update git-bulk.md: use correct stylization in synopsis

* update derived documents for git-bulk
2024-09-19 11:17:00 +08:00
wyattscarpenter f0671e2733
Update git-repl.md: typo: "let's" for "lets" (#1158)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-09-16 12:19:03 -07:00
Revisor 2c161aae02
Update instructions for the OpenSUSE installation (#1157)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-09-04 13:59:35 +08:00
Wiktor Żurawik f0b9e18e54
Add pathspec support in git-missing (#1156)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
* feat: Add pathspec support in git-missing

Allow to specify a path to limit the commit difference list. This
improvement allows users to focus on changes in specific directories or
files when comparing branches for missing commits.

* refactor: Improve pathspec handling in git-missing

- Change pathspec from string to array to support multiple pathspecs
- Remove unnecessary 'shift' command in argument processing loop
- Simplify git log command execution by using a single codepath

* chore: Update git-missing docs

* chore: Fix a typo in git-missing docs
2024-08-26 10:38:15 +08:00
CodeByZach c32869de37
feat: add rename-file command (#1149)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-08-02 01:19:35 -07:00
Matt Headley e1a4e7195d
Update Commands.md (#1148)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled
2024-07-05 10:15:22 +08:00
Wen Sun b766a655ce
fix: git-summary commit count (#1147)
* fix: git-summary commit count

* fixup! fix: git-summary commit count
2024-06-18 11:13:07 +08:00
Raphael Boidol e34dea9b7a
tests: update dependencies (#1142) 2024-05-03 14:52:28 +08:00
dependabot[bot] 3bac05e690
chore(deps): bump masesgroup/retrieve-changed-files from 2 to 3 (#1144)
Bumps [masesgroup/retrieve-changed-files](https://github.com/masesgroup/retrieve-changed-files) from 2 to 3.
- [Release notes](https://github.com/masesgroup/retrieve-changed-files/releases)
- [Commits](https://github.com/masesgroup/retrieve-changed-files/compare/v2...v3)

---
updated-dependencies:
- dependency-name: masesgroup/retrieve-changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 09:59:50 +08:00
dependabot[bot] a7ad306a6b
chore(deps): bump actions/setup-go from 4 to 5 (#1143)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 09:59:43 +08:00
Raphael Boidol dcb8bd6c54
ci: add dependabot update for GitHub actions (#1141) 2024-04-28 10:06:37 +08:00
Raphael Boidol a1bf09e8e0
ci: update actions (#1140) 2024-04-27 18:04:27 +08:00
罗泽轩 615ea971cb
Bump version to 7.3.0-dev (#1139)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2024-04-25 10:53:37 +08:00
罗泽轩 e692b9619a
Version 7.2.0 (#1138)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2024-04-23 19:59:09 +08:00
Leroy a17d2fb15d
refactor: test utils and simplify the case code (#1136)
* doc(tests/README.md): explain the unit test process

* test(TempRepository): support to change origin and get filename

* refactor: simplify the case code

    * test_git_browse_ci.py
    * test_git_browse.py

* fix: rename `test_authors.py` to `test_git_authors.py`

* fix: typo

* fix: log the GitCommandError
2024-02-29 11:11:00 +08:00
Edwin Kofler 52897f73b9
Add --proceed flag to git-delete-squashed-branches (#1134) (#1135)
Co-authored-by: Norbert Kiesel <nk@iname.com>
2024-02-20 10:47:36 +08:00
Leroy 5f19424a50
test(browse-ci): add unit tests (#1130) 2024-01-30 10:43:32 +08:00
Leroy b54d8c7c50
test(git-browse): add unit tests (#1127)
* chore: add the dependency testpath@0.6.0

* test(git-browse): add unit tests

* fix: update origin name to `tj/git-extras`
2024-01-05 14:31:37 +08:00
Josh McKinney 9049967232
feat: add reverse option to git-brv (#1123)
* feat: add reverse option to git-brv

When there are a large amount of branches it is often useful to see the
most recent branches last as they end up closer to the prompt. This adds
a new --reverse / -r option and an environment variable to set the
default behavior (GIT_BRV_REVERSE).

* git-brv: change to git option instead of environment variable and fix typo

* wrap git option in backticks for git-brv and fix git-feature title

* update git-feature docs

* fix missing breaks in git-feature.md
2023-12-16 12:05:52 +08:00
Edwin Kofler cdbcef3227
Merge pull request #1124 from rasa/patch-3
fix(utimes): change /dev/stdin to -
2023-12-14 19:36:32 -08:00
Ross Smith II a4b637346d
fix(utimes): change /dev/stdin to -
As not all environments have /dev/stdin. See https://github.com/ish-app/ish/issues/944
2023-12-13 07:51:50 -08:00
Ross Smith II 1843afb38a
fix(utimes): Support filenames with backspaces, etc. (#1122) 2023-12-12 14:50:21 +08:00
Leroy 28b48c7432
chore: add poetry to handle the tests of the git extras (#1121)
* chore: add poetry to handle the tests of the git extras

* chore(ci): upgrade the deps version

* chore(CONTRIBUTING): remove the test description
2023-12-01 14:25:14 +08:00
Ross Smith II 2c2bd07693
Fix typo in ci.yml (#1120) 2023-11-25 14:02:35 +08:00
Ross Smith II e39b1ab6a6
Fix: harden utimes, use single quotes (#1109)
* Fix: harden utimes, use single quotes

* Remove passing --posix to bash

* Remove double-quotes and backslashes

* Fix: patch git-utimes (fixes #1118)

Fixes #1118

* Fix formatting issue in git-utimes

Per https://github.com/tj/git-extras/pull/1109#discussion_r1399965099
2023-11-23 11:39:56 +08:00
Ross Smith II 058cb0763e
Fix: patch git-utimes (fixes #1118) (#1119)
I don’t have a Mac/BSD system to test, but this should fix #1118
2023-11-23 11:38:33 +08:00
罗泽轩 3d964687fc
add pull request manner (#1113)
* add pull request manner

Signed-off-by: spacewander <spacewanderlzx@gmail.com>

* Update .github/PULL_REQUEST_TEMPLATE.md

Thanks for @hyperupcall

Co-authored-by: Edwin Kofler <edwin@kofler.dev>

---------

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
2023-11-21 10:39:44 +08:00
Edwin Kofler ca18c6e552
maintenance: Add my name as maintainer in AUTHORS (#1117) 2023-11-21 10:32:52 +08:00
Leroy cf9fe2d23f
test(git-authors): add unit test (#1098) 2023-11-18 10:20:19 +08:00
Edwin Kofler c13ab52138
Add more comprensive dependencies (#1111) 2023-11-18 10:19:10 +08:00
René 58c5b50514
fix: git-standup find error (tj#1106) (#1110) 2023-11-14 12:05:28 +08:00
Edwin Kofler 5020890c34
Improve defaults for testing suite (#1104) 2023-11-11 12:55:46 +08:00
Ross Smith II 4d8060e8cb
feat: Speed up utimes (#1108) 2023-11-11 12:52:04 +08:00
Edwin Kofler 7a65311b1c
Overhaul CONTRIBUTING document (#1103) 2023-11-11 12:50:50 +08:00
罗泽轩 186bbdcb87
Bump version to 7.2.0-dev (#1099)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2023-11-02 12:00:12 +08:00
罗泽轩 bfef91f30a
Version 7.1.0 (#1097) 2023-10-29 18:52:56 +08:00
罗泽轩 78c5ca28a0
git-cp: don't stop execution when merge.ff is not set (#1096)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2023-10-26 12:28:19 +08:00
Wei Wu 90221f2149
Allow git cp to create destination folder automatically (#1091)
* Allow `git cp` to create destination folder automatically

* Replace subshell command with builtin operation to infer DESTINATION_DIR

* Remove destination folder existence check and only create it when the path contains slash(s)
2023-10-25 12:03:36 +08:00
Edwin Kofler 263dcb4a79
fix: Use -iname and expressions instead of -iregex (#1094) 2023-10-24 21:52:59 +08:00
罗泽轩 cc1c0e1a38
change installation source from master to main (#1092)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2023-10-23 12:13:40 +08:00
Leroy 04bf403861
test(git-archive-file): add unit test (#1084) 2023-10-17 13:54:09 +08:00
Edwin Kofler 5fe4226865
ci: Use Go v1.20 for running editorconfig-checker (#1086) 2023-10-15 10:19:41 +08:00
Leroy bddb987383
test(git-alias): add its unit test (#1077) 2023-09-27 10:21:35 +08:00
Edwin Kofler df1997c0dc
makefile: Allow bypassing conflict check (#1080) 2023-09-26 11:35:24 +08:00
Edwin Kofler 954ba1fb7c
fix: Restore zsh completions to working completion (#1079) 2023-09-23 13:38:15 +08:00
Gerrit-K e4152db482
fix: add missing quote in git-extras-completion.zsh (#1078)
Broken in #1074
2023-09-22 19:31:09 +08:00
Edwin Kofler dee7c7f1d0
feat: Implement completion for git coauthor (#1074) 2023-09-22 11:58:01 +08:00
Edwin Kofler e793f8979b
fix: Move improvements via ShellCheck (#1075) 2023-09-22 11:57:48 +08:00
Leroy d2dde69d14
feat(auto-test): CI with pytest (#1066)
* feat(ci): add pull request action and pytest.ini

* test(git-abort): add its unit test
2023-09-19 11:11:43 +08:00
Austin Ziegler 49650eda62
git-feature: add configurable branch separator (#1072)
* git-feature: add configurable branch separator

Closes #1069

This allows the use of a separator other than `/` for feature or other
alias branches. While a command-line option has been provided (`-s` or
`--separator`), this will most often be used via
`git-extras.feature.separator`.

* Significant update to bin/git-feature

- Changed option parsing so that `--alias` requires an argument and will
  fail with an error unless provided. Applied the same logic to
  `--separator`.

- Changed `finish` parsing to capture it as a variable flag during
  argument parsing.

  This could be extended so that if `finish` is already true, a second
  `finish` results in the word being added to the argument list.

  ```console
  $ git feature -- finish remote
  $ git feature finish finish remote
  ```

  This has not been done because it is a bit of an inconsistent handling
  for documentation purposes.

- Add handling of `--` to permit options or `finish` to be made part of
  the feature branch name.

- Since `finish` is now a variable flag, simplify the name-building
  logic to always use `concatargs "${argv[@]}"`. This means that
  `git feature finish ...` and `git feature ...` behave the same in
  terms of feature branch name building.

- Basically rewrote the man page to include better descriptions of the
  options as well as adding a GIT CONFIG section and additional EXAMPLES
  for the new features/behaviour.
2023-09-19 11:10:59 +08:00
Dan Goodliffe 76cd9bdf45
git-psykorebase: determine branch names with bash pattern substitution (#1073)
Co-authored-by: Dan Goodliffe <dan.goodliffe@octal.co.uk>
2023-09-17 22:07:32 +08:00
罗泽轩 f95e339c03
git-cp: continue to merge when merge.ff is only (#1070)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2023-09-13 13:02:06 +08:00
Austin Ziegler db71be578e
git archive-file: change base ARCHIVE_NAME (#1071)
Closes #1067

This makes the base ARCHIVE_NAME for `git-archive-file` to be the name
of the repo root directory instead of the name of the current directory.
2023-09-13 13:01:37 +08:00
Edwin Kofler cb29c62c65
readme: Add secondary location of screencast (#1065)
And, fix other typos.
2023-08-29 19:37:54 +08:00
Edwin Kofler 47e940272a
fix: Improve Bash hygiene (#1056)
* fix: Improve Bash hygiene

* Update quoting to account for new bugs

* quotes

* fix: Remove extra shellcheck comment
2023-08-18 16:15:40 +08:00
Edwin Kofler 8af43892f6
feat: Implement git-get command (#1045)
* feat: Add `git-get` command

* Update Commands.md

Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>

* fix: Use Git config to store value

* improve `git-get` description

* fix: Add `--global` to git invocation

* Enable passing options to `git clone`

* fix: Ordering of checks

---------

Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
2023-08-12 13:49:33 +08:00
SchleimKeim 34609bd800
Corrected grammar in bin/git-cp (#1061)
Corrected grammar in bin/git-cp:41
2023-08-10 15:35:01 +08:00
Edwin Kofler 0b5d2cce55
Improve git-ignore command (#1047)
* Improve `git-ignore` command

* fix: Improve warnings/errors and modify `not_need_git_repo`
2023-07-13 14:29:39 +08:00
Jobin Kurian d7fb4495f1
I have made two improvements to the git-bulk: (#1054)
* I have made two improvements to the git-bulk:
1. Previously, if the "repository.txt" file did not end with a blank line, only three out of four repositories were cloned. This limitation has been fixed.
2. Now, there is support for cloning repositories into custom folder names when using the "repository.txt" file.

* Corrected the code indentation.

* removed the extra condition to check is the line was empty or not.

* Updated the comment for the new changes in the code.

---------

Co-authored-by: Jobin Kurian <jobin.kurian@netcorecloud.com>
2023-07-07 11:08:23 +08:00
Hemanth HM 5e543cb620
Merge pull request #1052 from spacewander/gsm
Add typo checker
2023-06-19 08:24:24 -07:00
kang 3a258cbaad
Type properly __gitex_command_successful calls and capitalizate github to GitHub (#1049)
* Type properly `__gitex_command_successful` calls

* Capitalize github to GitHub
2023-06-19 22:05:30 +08:00
spacewander ba9e6f0c5c Add typo checker 2023-06-19 21:51:53 +08:00
Nate Eagleson 5d7ed18c50
Fix comment typo in git-authors (#1050) 2023-05-29 10:25:08 +08:00
Edwin Kofler 2d221c1b67
tweak: Fix typos (#1046) 2023-05-18 10:19:24 +08:00
Igor Ostapenko f5bcbe5b0d
Makefile: init SYSCONFDIR before using it (#1044) 2023-05-08 09:57:55 +08:00
Igor Ostapenko 6d73f74f83
Makefile: tune MANPREFIX configuration for FreeBSD (#1043)
We could think of the following use cases:

1. User installs git-extras from official port/pkg. man/man* structure
is quite common among different systems, but location of man/ itself can
be different. FreeBSD Ports framework setups MANPREFIX to PREFIX by
default, i.e. it's /usr/local. The idea is that software may provide
different man/man* sections, with final path being /usr/local/man/man*.
In contrast, git-extras' Makefile process simplifies the things due to
it works with section 1 only, and expects MANPREFIX to be set down to
man/man1 path. For this reason, installation via FreeBSD Ports requires
unconditional man path configuration like this:

    ifeq ($(OS), FreeBSD)
        MANPREFIX = "$(PREFIX)/man/man1"

Otherwise, the path will be incorrect. And this is how official FreeBSD
port of git-extras has been fixing this difference for many years.

2. End user installs git-extras manually. There are two sub-cases:

  2.a. User explicitly defines custom MANPREFIX. Okay, it's user's
  decision -- nothing to do here, just follow as is.

  2.b. User does not define custom paths, i.e. it's expected to be
  installed according to FreeBSD defaults. And default values in
  git-extras' Makefile forms the expected correct path.

This change supports all the cases above, with the goal to avoid wrong
man path for the most of the situations. As long as official git-extras
make process tries to support FreeBSD, this change allows to omit extra
patching for FreeBSD Ports framework.
2023-05-05 09:46:38 +08:00
Igor Ostapenko bbf90c4623
Makefile: set bash COMPL_DIR to FreeBSD expected defaults (#1042)
See official conventions: https://docs.freebsd.org/en/books/porters-handbook/special/#shell-completion
2023-05-04 11:19:25 +08:00
罗泽轩 2fca5edb7d
Bump version to 7.1.0-dev (#1041) 2023-04-26 10:29:51 +08:00
200 changed files with 6803 additions and 2450 deletions

View file

@ -17,3 +17,14 @@ trim_trailing_whitespace = false
[*.html]
trim_trailing_whitespace = false
[*.py]
indent_size = 4
[*.bats]
indent_style = tab
indent_size = 4
[tests/*.sh]
indent_style = tab
indent_size = 4

2
.github/.ignore_words vendored Normal file
View file

@ -0,0 +1,2 @@
gool
Cant

12
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,12 @@
<!--
Note
* Mark the PR as draft until it's ready to be reviewed.
* Please update the documentation to reflect the changes made in the PR.
* If the command is covered by tests under ./tests, please add/update tests for any changes unless you have a good reason.
* Make a new commit to resolve conversations instead of `push -f`.
* To resolve merge conflicts, merge from the `main` branch instead of rebasing over `main`.
* Please wait for the reviewer to mark a conversation as resolved.
-->

6
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View file

@ -1,46 +1,112 @@
name: ci
on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]
jobs:
lint:
runs-on: 'ubuntu-22.04'
runs-on: ubuntu-latest
steps:
- name: Check out code.
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: 'Get Changed Files'
id: 'files'
uses: 'masesgroup/retrieve-changed-files@v2'
with:
format: 'json'
- name: Check out code.
uses: actions/checkout@v2
- name: 'Check EditorConfig Lint'
run: |
sudo apt install -y jq golang
go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest'
CHANGED_FILES=$(git diff --name-only "${BASE_SHA:-$BEFORE_SHA}...${HEAD_SHA:-$GITHUB_REF}")
echo "::notice::Changed files: $CHANGED_FILES"
{
echo "added_modified<<EOF"
echo "$CHANGED_FILES"
echo "EOF"
} >> "$GITHUB_OUTPUT"
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BEFORE_SHA: "${{ github.event.before }}"
- name: 'Check Generated Manuals'
run: |
failed=0
while IFS= read -r source; do
case "$source" in
man/git-*.md)
stem=${source%.md}
for generated in "$stem.1" "$stem.html"; do
if ! grep -Fqx -- "$generated" <<< "$CHANGED_FILES"; then
echo "::error file=$source::$generated must be updated with $source"
failed=1
fi
done
;;
esac
done <<< "$CHANGED_FILES"
exit "$failed"
env:
CHANGED_FILES: "${{ steps.files.outputs.added_modified }}"
- uses: 'actions/setup-go@v7'
with:
go-version: '1.20'
- name: 'Install EditorConfig Lint'
run: go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest'
- name: 'Check EditorConfig Lint'
run: echo "$FILES" | xargs ~/go/bin/editorconfig-checker
env:
# NOTE: use env to pass the output in order to avoid possible injection attacks
FILES: "${{ steps.files.outputs.added_modified }}"
- name: checkstyle
run: ./scripts/checkstyle.py
- name: Shellcheck
run: shellcheck --severity=error bin/* ./*.sh
readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')"
~/go/bin/editorconfig-checker ${changed_files[@]}
typo:
runs-on: ubuntu-latest
steps:
- name: Check out code.
uses: actions/checkout@v7
- name: Install codespell
run: python3 -m pip install codespell==2.4
- name: spell check
run: |
git grep --cached -l '' . | \
grep -v -e 'History\.md' -e 'AUTHORS' -e 'man/.*\.1' -e 'man/.*\.html' | \
xargs codespell --ignore-words=.github/.ignore_words
test-bats:
name: 'Test with Bats'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Setup Bats
id: setup-bats
uses: bats-core/bats-action@4.0.0
with:
bats-version: 'v1.8.1'
- name: Test with Bats
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
TERM: xterm
run: bats ./tests
build:
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-22.04
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Check out code.
uses: actions/checkout@v2
uses: actions/checkout@v7
- name: Linux Install
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get install -y bsdmainutils
if: matrix.platform == 'ubuntu-latest'
run: sudo apt-get install -y bsdmainutils
- name: Script
run: |
./check_integrity.sh $(find bin | cut -b 5- | xargs)
run: ./check_integrity.sh
- name: Brew release
if: matrix.platform == 'macos-latest'
run: |

18
.github/workflows/stale.yaml vendored Normal file
View file

@ -0,0 +1,18 @@
name: "Maintenance: Close Stale PRs"
on:
schedule:
- cron: "30 1 * * *"
permissions:
pull-requests: "write"
jobs:
stale:
runs-on: "ubuntu-latest"
if: github.repository_owner == 'tj'
steps:
- uses: "actions/stale@v11"
with:
close-pr-message: "This PR was closed because it has been stalled for 365 days with no activity. Feel free to make a new PR if you wish to continue"
days-before-pr-stale: 350
days-before-pr-close: 15

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.venv/
__pycache__/
coverage/

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "vendor/bats-all"]
path = vendor/bats-all
url = https://github.com/hyperupcall/bats-all

5
.pytest.ini Normal file
View file

@ -0,0 +1,5 @@
[pytest]
minversion = 7.4
addopts = -ra -q
testpaths = tests
faulthandler_timeout = 5

369
AUTHORS
View file

@ -1,16 +1,14 @@
git-extras is written and maintained by TJ Holowaychuk and
various contributors:
Development Lead
````````````````
- TJ Holowaychuk <tj@vision-media.ca>
git-extras is written and maintained by various contributors:
Maintainers
```````````
- TJ Holowaychuk <tj@vision-media.ca>
- Hemanth.HM <hemanth.hm@gmail.com>
- Nimit Kalra <me@nimit.io>
- Nicolai Skogheim <nicolai.skogheim@gmail.com>
- spacewander <spacewanderlzx@gmail.com>
- Edwin Kofler <edwin@kofler.dev>
- Leroy <vanpipy@gmail.com>
Patches and Suggestions
```````````````````````
@ -23,101 +21,231 @@ Patches and Suggestions
- CJ
- Paul Wise
- Damien Tardy-Panis
- Yuriy VG
- Mark Eissler
- Richard Fearn
- Yuriy VG
- Leila Muhtasib
- Jesús Espino
- go2null
- Richard Fearn
- Bill Wood
- Jesús Espino
- Rémy HUBSCHER
- go2null
- Andrew Janke
- Peter Benjamin
- Edwin Kofler
- Jan Schulz
- David Baumgold
- Mark Pitman
- Jan Schulz
- Kenneth Reitz
- Mark Pitman
- Peter Benjamin
- Günther Grill
- Luke Childs
- Sasha Khamkov
- Günther Grill
- equt
- oikarinen
- vyas
- Robin Winslow
- grindhold
- Don Harper
- Pierre Ayoub
- Robin Winslow
- Ross Smith II
- Yi EungJun
- Carlos Prado
- vanpipy
- Chris Hall
- NANRI
- Camille Reynders
- Damian Krzeminski
- grindhold
- wyattscarpenter
- Aggelos Orfanakos
- Camille Reynders
- Carlos Prado
- Chris Hall
- Damian Krzeminski
- NANRI
- Alexander Krasnukhin
- Phally
- Rico Sta. Cruz
- Takuma Yamaguchi
- thomas menzel
- vr8ce
- Alexander Krasnukhin
- Rico Sta. Cruz
- Phally
- Takuma Yamaguchi
- gisphm
- jacobherrington
- Justin Dugger
- Brian J Brennan
- Dominik Gedon
- Hogan Long
- Ivan Malopinsky
- John Bachir
- Jonathan "Duke" Leto
- Richard Russon
- overengineer
- phigoro
- Julio Napurí
- Sam Bostock
- Justin Dugger
- Nils Winkler
- Philipp Klose
- wooorm
- Brian J Brennan
- Ivan Malopinsky
- Dominik Gedon
- Raphael Boidol
- Richard Russon
- Sam Bostock
- Vladimir Jimenez
- Guillaume Seren
- Florian H
- Beth Skurrie
- Evan Grim
- Tjaart van der Walt
- Justin Guenther
- Marc Harter
- Tom Vincent
- Allan Odgaard
- Matiss
- Wil Moore III
- William Montgomery
- Hozefa
- Ye Lin Aung
- gisphm
- jacobherrington
- overengineer
- phigoro
- wooorm
- Alexis GRIMALDI
- Brice Dutheil
- Allan Odgaard
- Andre Cerqueira
- Domenico Rotiroti
- Nate Jones
- Joshua Li
- Newell Zhu
- luozexuan
- roxchgt
- Austin Ziegler
- Beth Skurrie
- Brice Dutheil
- Curtis McEnroe
- Daniele Paolella
- David Rogers
- soffolk
- Richard Littauer
- Jean Jordaan
- Devin Withers
- Domenico Rotiroti
- Evan Grim
- Florian H
- Gert Van Gool
- Guillaume Seren
- Hozefa
- Igor Ostapenko
- Jean Jordaan
- Joshua Li
- Justin Guenther
- Kylie McClain
- Marc Harter
- Matiss
- Nate Jones
- Newell Zhu
- Patryk Małek
- Paul Schreiber
- Kylie McClain
- Curtis McEnroe
- Gert Van Gool
- Richard Littauer
- Tjaart van der Walt
- Tom Vincent
- Wil Moore III
- William Montgomery
- Ye Lin Aung
- luozexuan
- roxchgt
- soffolk
- 0xflotus
- Abdullah
- Adam Parkin
- Adriaan Zonnenberg
- Akim Demaille
- Alessandro Pagiaro
- Alex McHale
- Aloxaf
- Amir Tocker
- Ammar Najjar
- Amory Meltzer
- Andreas Duering
- Andrei Petcu
- Andrew Griffiths
- Andrew Marcinkevičius
- Andrew Starr-Bochicchio
- Andrew Sullivan Cant
- Andrey Elizarov
- Angel Aguilera
- Antoine Beaupré
- Aurélien Scoubeau
- Balazs Nadasdi
- Ben Parnell
- Beni Ben Zikry
- Brandon Zylstra
- Brian Goad
- Brian Murrell
- Bruno Sutic
- Caleb Maclennan
- Carl Casbolt
- Carlos Rodríguez
- Christophe Badoit
- Ciro Nunes
- CleanMachine1
- CodeByZach
- Craig MacGregor
- Dan Goodliffe
- Dan Jackson
- Dan Kilman
- Daniel Bruder
- Daniel Lublin
- Daniel Schildt
- Dave James Miller
- David Hartmann
- Dominic Barnes
- Dung Quang
- Edward Betts
- Eli Schwartz
- Emil Kjelsrud
- Erik Skultety
- François M
- George Crabtree
- Gerrit-K
- Greg Allen
- Guilhem Saurel
- Guillermo Rauch
- Gunnlaugur Thor Briem
- Hasse Ramlev Hansen
- Heiko Becker
- Hugo Ruiz-Mireles
- Isaac Mungai
- J.C. Yamokoski
- Jack O. Wasey
- James Manning
- James Zhu
- Jan Krueger
- Jared Baur
- Jarod Stewart
- Jason Young
- Jens K. Mueller
- Jeremy Lin
- Jesse Sipprell
- Jianjin Fan
- Jobin Kurian
- Johannes Ewald
- John Evans
- John Hoffmann
- Jon Ander Peñalba
- Josh McKinney
- Joshua Appelman
- José María Gutiérrez @TheTechOddBug
- Katrin Leinweber
- Kevin Woo
- Konstantin Schukraft
- Kurban Mallachiev
- Leandro López
- Lone
- Luis Miguel Hernanz
- Maarten Winter
- Marco Glasbergen
- Matan Rosenberg
- Mathieu D. (MatToufoutu)
- Matt
- Matt Colyer
- Matt Headley
- Matthew Avant
- Mattias Andersson
- Michael Komitee
- Michael Matuzak
- Michele Bologna
- Montak Oleg
- Moritz Grauel
- Nate Eagleson
- Nate Fischer
- Nathan Rajlich
- Nick Campbell
- Nick Payne
- Nicolas Kosinski
- Niklas Fiekas
- Oliver Kopp
- Orestis
- Peter Bittner
- Piotr Górski
- Prayag Verma
- Przemek Kitszel
- R. Martinho Fernandes
- Raphael Fleischlin
- Rasmus Wriedt Larsen
- René
- Revisor
- Ricardo Fernández Serrata
- Riceball LEE
- Rob Kennedy
- Robin von Bülow
- Russ
- Ryan Bohn
- Sachin Gupta
- Sam Thursfield
- Sandro
- Sascha Andres
- SchleimKeim
- Sean Molenaar
- Sebastian Gniazdowski
- Sebastián Mancilla
@ -138,19 +266,24 @@ Patches and Suggestions
- Valérian Galliat
- Vitaly Chikunov
- Wei Lee
- Wei Wu
- Wen Sun
- Wiktor Żurawik
- Xavier Krantz
- Xiaopei Li
- Zeeshan Ahmed
- ax1036
- brian murrell
- creynders
- dead-horse
- eszabpt
- fengkx
- johnpyp
- jykntr
- kang
- meza
- neydroid
- nulltask
- phanium
- sgleizes
- tfendin
- tiemonl
@ -161,107 +294,3 @@ Patches and Suggestions
- Étienne BERSAC
- ☃ pitr
- 单元源
- Przemek Kitszel
- Abdullah
- Adam Parkin
- Adriaan Zonnenberg
- Akim Demaille
- Alessandro Pagiaro
- Alex McHale
- Aloxaf
- Amir Tocker
- Ammar Najjar
- Amory Meltzer
- Andreas Duering
- Andrei Petcu
- Andrew Griffiths
- Andrew Marcinkevičius
- Andrew Starr-Bochicchio
- Andrey Elizarov
- Angel Aguilera
- Antoine Beaupré
- Aurélien Scoubeau
- Balazs Nadasdi
- Ben Parnell
- Beni Ben Zikry
- Brandon Zylstra
- Brian Goad
- Bruno Sutic
- Caleb Maclennan
- Carl Casbolt
- Carlos Rodríguez
- Christophe Badoit
- Ciro Nunes
- CleanMachine1
- Craig MacGregor
- Dan Jackson
- Dan Kilman
- Daniel Bruder
- Daniel Lublin
- Daniel Schildt
- Dave James Miller
- David Hartmann
- Dominic Barnes
- Dung Quang
- Edward Betts
- Eli Schwartz
- Emil Kjelsrud
- François M
- George Crabtree
- Greg Allen
- Guillermo Rauch
- Gunnlaugur Thor Briem
- Hasse Ramlev Hansen
- Heiko Becker
- Isaac Mungai
- J.C. Yamokoski
- Jack O. Wasey
- James Manning
- James Zhu
- Jan Krueger
- Jarod Stewart
- Jason Young
- Jens K. Mueller
- Jeremy Lin
- Jesse Sipprell
- Jianjin Fan
- Johannes Ewald
- John Evans
- John Hoffmann
- Jon Ander Peñalba
- Joshua Appelman
- José María Gutiérrez @TheTechOddBug
- Katrin Leinweber
- Kevin Woo
- Konstantin Schukraft
- Kurban Mallachiev
- Leandro López
- Lone
- Luis Miguel Hernanz
- Maarten Winter
- Marco Glasbergen
- Matan Rosenberg
- Mathieu D. (MatToufoutu)
- Matt
- Matt Colyer
- Matthew Avant
- Michael Komitee
- Michael Matuzak
- Michele Bologna
- Montak Oleg
- Moritz Grauel
- Nate Fischer
- Nathan Rajlich
- Nick Campbell
- Nick Payne
- Nicolas Kosinski
- Niklas Fiekas
- Oliver Kopp
- Orestis
- Peter Bittner
- Piotr Górski
- Prayag Verma
- 0xflotus
- R. Martinho Fernandes
- Raphael Fleischlin
- Rasmus Wriedt Larsen

View file

@ -1,15 +1,22 @@
## Your new git-extra command should support
# Contributing
* OSX, Linux, BSD (You may need to browse their man page)<sup>*</sup>
* Bash 3.2+ (If you aren't sure, see [the Bash changelog](https://www.tldp.org/LDP/abs/html/bash2.html))
* Git 2.1+
Thanks for contributing! Please read this document before you make a PR.
<sup>*</sup>If you aren't able to test your new command on a platform,
make that clear in your PR and someone else may be able to test it on their system.
## Supported Platforms
## To submit a new command, you should
Any changes must support the following platforms:
Let's assume your new command is named `foo`.
- macOS
- Linux
- OpenBSD (You may need to browse their man page)
Your change must also be compatible with the dependency constraints that we specify in [Installation](./Installation.md). If you aren't sure if a feature is compatible, check the manual or release notes. For example, the Bash changelog is [here](https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS?h=devel).
If you aren't able to test your new command on a platform, make that clear in your PR; someone else may be able to test it on their system.
## Adding a New Command
Let's say you wish to add a new command. Assuming your new command is named `foo`:
1. Write a bash script under `./bin` called `git-foo`. The script should be started with `#!/usr/bin/env bash`.
2. Read `./man/Readme.md` and write documentation for `git-foo`.
@ -17,6 +24,11 @@ Let's assume your new command is named `foo`.
4. Update `./etc/git-extras-completion.zsh`. Just follow existing code.
5. (Optional) Update `./etc/bash_completion.sh`.
6. (Optional) Update `./etc/git-extras.fish`.
7. Run `./check_integrity.sh foo` to check if all done.
7. (Optional) Add a test under `./tests`.
8. Run `./check_integrity.sh foo` to check if all done. (You may also run `./check_integrity.sh` to check all commands.)
You are welcome to open up an issue to discuss new commands or features before opening a pull request.
## Submitting a pull request
Please follow the suggestion in `./.github/PULL_REQUEST_TEMPLATE.md`.

View file

@ -12,11 +12,13 @@
- [`git clear-soft`](#git-clear-soft)
- [`git coauthor`](#git-coauthor)
- [`git commits-since`](#git-commits-since)
- [`git continue`](#git-continue)
- [`git contrib`](#git-contrib)
- [`git count`](#git-count)
- [`git cp`](#git-cp)
- [`git create-branch`](#git-create-branch)
- [`git delete-branch`](#git-delete-branch)
- [`git delete-gone-branches`](#git-delete-gone-branches)
- [`git delete-merged-branches`](#git-delete-merged-branches)
- [`git delete-squashed-branches`](#git-delete-squashed-branches)
- [`git delete-submodule`](#git-delete-submodule)
@ -28,6 +30,7 @@
- [`git force-clone`](#git-force-clone)
- [`git fork`](#git-fork)
- [`git fresh-branch`](#git-fresh-branch)
- [`git get`](#git-get)
- [`git gh-pages`](#git-gh-pages)
- [`git graft`](#git-graft)
- [`git guilt`](#git-guilt)
@ -51,6 +54,7 @@
- [`git rebase-patch`](#git-rebase-patch)
- [`git release`](#git-release)
- [`git rename-branch`](#git-rename-branch)
- [`git rename-file`](#git-rename-file)
- [`git rename-tag`](#git-rename-tag)
- [`git rename-remote`](#git-rename-remote)
- [`git repl`](#git-repl)
@ -72,6 +76,8 @@
- [`git undo`](#git-undo)
- [`git unlock`](#git-unlock)
- [`git utimes`](#git-utimes)
- [`git unwip`](#git-unwip)
- [`git wip`](#git-wip)
## git extras
@ -176,8 +182,8 @@ authors :
1 Guillermo Rauch 0.6%
```
This command can also take a *commitish*, and will print a summary for commits in
the commitish range:
This command can also take a *committish*, and will print a summary for commits in
the committish range:
```bash
$ git summary v42..
@ -223,7 +229,7 @@ project : git-extras
The `--line` option can also take a path, which will print a filtered summary for that folder or file.
The option `--output-style` tries to put as much summary information of the repo into defined styled way as possible.
This is how the `tebular` output style and `oneline` output style look like
This is how the `tabular` output style and `oneline` output style look like
```bash
$ git summary --output-style tabular
@ -277,11 +283,20 @@ usage: git bulk [-g] ([-a]|[-w <ws-name>]) <git command>
git bulk --listall
```
Register a workspace so that `git bulk` knows about it (notice that <ws-root-directory> must be absolute path):
Register a workspace so that `git bulk` knows about it (it will be registered in your `.gitconfig`):
```bash
$ git bulk --addworkspace personal ~/workspaces/personal
```
Notice that `<ws-root-directory>` must be an absolute path (or an environment variable pointing to an absolute path).
In the case of a **single quoted environment variable**, it will be dereferenced at `git-bulk` runtime, suitable for dynamic workspaces (*e.g.*, defined in your `.bashrc`).
As an illustration:
```bash
$ git bulk --addworkspace personal '$PERSONAL_WORKSPACE'
```
With option `--from` the URL to a single repository or a file containing multiple URLs can be added and they will be cloned directly into the workspace. Suitable for the initial setup of a multi-repo project.
```bash
@ -358,6 +373,13 @@ $ git brv
2020-01-08 master origin/master 265b03e Merge pull request #816 from spacewander/git-sed-pathspec
```
When your repo has many branches, it can be more convenient to see this list in reverse. This can be set as the default by setting the git-extras.brv.reverse git option to true.
```bash
$ git brv --reverse
2020-01-08 master origin/master 265b03e Merge pull request #816 from spacewander/git-sed-pathspec
2020-01-14 adds-git-brv fork/adds-git-brv 1ca0d76 Fixes #700: Adds git-brv
```
## git repl
@ -366,14 +388,53 @@ Git read-eval-print-loop. Lets you run `git` commands without typing 'git'.
Commands can be prefixed with an exclamation mark (!) to be interpreted as
a regular command.
Type `exit` or `quit` to end the repl session.
Type `exit`, `quit`, or `q` to end the repl session.
Any arguments to git repl will be taken as the first command to execute in
the repl.
### CONFIGURATION
Commands entered in a repl session will be saved to a history file and be available in
future sessions, similar to a shell or programming language repl. By default,
there is one global history file, ~/.git_repl_history. You can specify that your projects
each have their own independent history file. This file will be saved in .git_repl_history
at the top level of the repo, and will need to be added to the repo or global .gitignore.
```bash
# remove the --global flag to configure only an individual project to have its own history file
git config --global git-extras.repl.use-local-history "true"
```
You can specify a default command to run when hitting enter:
```bash
git config --global git-extras.repl.on-enter-command "git status -sb"
```
You can configure which character is used at the end of the prompt: (default `>`):
```bash
git config --global git-extras.repl.prompt-character "±"
```
You can specify the prefix for the prompt, or remove it (default `git`):
```bash
git config --global git-extras.repl.prefix ""
```
You can have the name of the current git repo shown in the prompt (default `false`):
```bash
git config --global git-extras.repl.show-project-name "true"
```
```bash
$ git repl
git version 2.9.2
git-extras version 3.0.0
type 'ls' to ls files below current directory,
'!command' to execute any command or just 'subcommand' to execute any git subcommand
git version 2.34.1
git-extras version 7.3.0
Type 'ls' to ls files below current directory; '!command' to execute any command or just 'subcommand' to execute any git subcommand; 'quit', 'exit', 'q', ^D, or ^C to exit the git repl.
git (master)> ls-files
History.md
@ -404,9 +465,9 @@ $ git coauthor user user@email.com
2 files changed, 145 insertions(+), 0 deletions(-)
create mode 100644 README.md
create mode 100644 CONTRIBUTING.md
$ git log -1
commit b62ceae2685e6ece071f3c3754e9b77fd0a35c88 (HEAD -> master)
Author: user person <userperson@email.com>
Date: Sat Aug 17 17:33:53 2019 -0500
@ -551,6 +612,20 @@ $ git rename-branch old-name new-name
$ git rename-branch new-name
```
## git rename-file
Rename a file or directory and ensure Git recognizes the change, regardless of filesystem case-sensitivity.
It combines the functionality of the `mv` command and `git mv`. This is particularly useful for renaming files or directories
to change only their case, which might not be detected by Git on case-insensitive filesystems.
```bash
# Rename a file
git rename-file old_filename new_filename
# Rename a directory
git rename-file old_directory new_directory
```
## git rename-tag
Rename a tag (locally and remotely).
@ -858,6 +933,21 @@ Delete local and remote tag `name`:
$ git delete-tag 0.0.1
```
## git delete-gone-branches
Deletes all local branches whose remote-tracking branch has been deleted (i.e. branches shown as `[gone]` in `git branch -vv`). Use `--dry-run` to preview what would be deleted.
```bash
$ git delete-gone-branches
Deleted branch feature-123 (was abc1234).
Deleted branch feature-456 (was def5678).
$ git delete-gone-branches --dry-run
Would delete the following branches:
feature-123
feature-456
```
## git delete-merged-branches
Deletes branches that are listed in `git branch --merged`.
@ -883,12 +973,21 @@ $ (main) git ...
## git fresh-branch
Create empty local branch `name`:
Create empty local branch `docs`:
```bash
$ git fresh-branch docs
```
## git get
Clone repository into a subdirectory of the configured path, `"$HOME/some-dir"`:
```bash
$ git config --global --add git-extras.get.clone-path "$HOME/some-dir"
$ git get 'https://github.com/hyperupcall/bake'
```
## git guilt
Calculate the change in blame between two revisions
@ -943,8 +1042,6 @@ $ git squash HEAD~3 "Work on a feature"
Populates the file matching `authors|contributors -i` with the authors of commits, according to the number of commits per author.
Opens the file in `$EDITOR` when set.
See the ["MAPPING AUTHORS" section](https://git-scm.com/docs/git-shortlog#_mapping_authors) of **git-shortlog**(1) to coalesce together commits by the same person.
Updating AUTHORS file:
@ -1106,6 +1203,14 @@ Internally this script uses `rsync` and not `scp` as the name suggests.
`git-rscp` - The reverse of `git-scp`. Copies specific files from the working directory of a remote repository to the current working directory.
The following options are available (must precede `<remote>`):
```bash
-v, --verbose Print what will be synced before syncing
-i, --interactive Prompt for confirmation before syncing (implies --verbose)
-n, --dry-run Show what would be synced, change nothing (implies --verbose)
```
### Examples
Copy unstaged files to remote. Useful when you want to make quick test without making any commits
@ -1266,7 +1371,7 @@ Creates a zip archive of the current git repository. The name of the archive wil
## git missing
Print out which commits are on one branch or the other but not both.
Print out which commits are on one branch or the other but not both. Optionally, you can specify a path to limit the comparison to a specific directory or file.
```bash
$ git missing master
@ -1274,6 +1379,12 @@ $ git missing master
> 97ef387 only on master
```
```bash
$ git missing master -- src/
< ed52989 only on current branch, in src/ directory
> 7988c4b only on master, in src/ directory
```
## git lock
Lock a local file `filename`:
@ -1317,8 +1428,8 @@ $ git reset-file .htaccess dc82b19
## git mr
Checks out a merge request from GitLab. Usage: `git mr <ID|URL> [REMOTE]`.
Default remote is `origin`.
Checks out a merge request from GitLab, or a pull request from Forgejo/Codeberg.
Usage: `git mr <ID|URL> [REMOTE]`. Default remote is `origin`.
``` bash
$ git mr 51
@ -1330,12 +1441,21 @@ Switched to branch 'mr/51'
With full URL, the head is fetched from a temporary remote pointing to the base URL.
``` bash
$ git mr https://gitlab.com/owner/repository/merge_requests/51
$ git mr https://gitlab.com/owner/repository/merge_requests/51
From gitlab.com:owner/repository
* [new ref] refs/merge-requests/51/head -> mr/51
Switched to branch 'mr/51'
```
A Forgejo/Codeberg pull request URL is also supported:
``` bash
$ git mr https://codeberg.org/owner/repository/pulls/51
From codeberg.org:owner/repository
* [new ref] refs/pull/51/head -> mr/51
Switched to branch 'mr/51'
```
Just like [git pr](#git-pr), `git mr` accepts a `clean` argument to trash all
`mr/` branches. Ensure current branch is not one.
@ -1585,3 +1705,25 @@ Abort current revert, rebase, merge or cherry-pick, without the need to find exa
## git magic
Commits changes with a generated message.
## git continue
Continue current revert, rebase, merge or cherry-pick, without the need to find exact command in history.
## git wip
Create a Work In Progress(WIP) commit, which will include all changes in the
working directory. (i.e., changes to existing files, new files, removed files)
```bash
$ git wip
```
## git unwip
Undo a Work In Progress(WIP) commit and put all of those changes back into the
working directory.
```bash
$ git unwip
```

View file

@ -1,4 +1,142 @@
7.5.0 / 2026-05-09
==================
* Use standard prefix for home dir installs (#1248)
* refactor(abort): common `gitdir` (#1244)
* Fix man page usage docs (#1241)
* Fix `git-changelog` to handle whitespace in command arguments (#1232)
* chore(deps): bump bats-core/bats-action from 3.0.1 to 4.0.0 (#1230)
* add details when multiple active operations found (#1229)
* Add persistent history to `git-repl` (#1226)
* Support passing ref to `git-commits-since` (#1228)
* ability to specify command when hitting enter (#1223)
* Improve `git-repl` prompt (#1224)
* feat: `delete-branch` multiple unique branch names completions (#1221)
* chore(deps): bump actions/checkout from 5 to 6 (#1219)
* Made Git Magic use `--force-with-lease` (#1218)
* chore(deps): bump actions/stale from 9 to 10 (#1214)
* chore(deps): bump actions/setup-go from 5 to 6 (#1215)
* chore(deps): bump actions/setup-python from 5 to 6 (#1216)
* Fix minor typo in `git rename-branch` man page (#1211)
* Improvements to Bash completion (#1210)
* Fix use of `git-whatchanged` to `git-log` (#1212)
* chore(deps): bump actions/checkout from 4 to 5 (#1209)
* Bump version to 7.5.0-dev (#1207)
7.4.0 / 2025-06-19
==================
* Format comparisons, functions, and redirections to be consistent (#1201)
* add git-wip and git-unwip (#669)
* chore(deps): bump bats-core/bats-action from 3.0.0 to 3.0.1
* Mostly finish pytest to Bats conversion (#1200)
* Implement half of tests in Bats (#1187)
* Add stale bot for old PRs (#1186)
* feat(git-bulk): add new option to not follow hidden directories (#1195)
* Feat: allow git-summary showing full path of repository (#1193)
* feat(git-bulk): add new option to no follow symlinks (#1194)
* docs(git-bulk): Add zsh completion (#1190)
* fix(git-bulk): fix workspace selection when cd fails (#1197)
* fix(git-bulk): quiet find errors by default (#1196)
* fix(git-bulk): fix a bad integer expression (#1198)
* chore(deps): bump astral-sh/ruff-action from 2 to 3 (#1189)
* Fix all ShellCheck errors and add to CI (#1179)
* chore(deps): bump astral-sh/ruff-action from 1 to 2 (#1188)
* fix(ci): use poetry (#1183)
* Delete etc/test.fish (#1185)
* feat: add git-continue (#1176)
* feat: add ruff linter with ci check (#1182)
* fix(ci): missing dollar sign (#1184)
* fix(github-actions): changed files output for editorcondig-checker (#1180)
* Revert "feat: add ruff linter with ci check (#1178)" (#1181)
* feat: add ruff linter with ci check (#1178)
* Support `GITHUB_TOKEN` var for `git-fork` and `git-pull-request` (#1177)
* Bump version to 7.4.0-dev (#1175)
7.3.0 / 2024-10-20
==================
* Fix stripping trailing forward slash for git-get (#1172)
* Change git-cp to use cleaner branch approach (#1169)
* Improve warning for `git clear` (#1168)
* Enhance `git-repl` (#1160)
* Update some documentation that was out of sync (#1164)
* Use filetimes in check_integrity (#1162)
* Update git-alias.md: add brs to prevent incorrect line behavior (#1161)
* Update git-bulk.md: use correct stylization in synopsis (#1163)
* Update git-repl.md: typo: "let's" for "lets" (#1158)
* Update instructions for the OpenSUSE installation (#1157)
* Add pathspec support in `git-missing` (#1156)
* feat: add rename-file command (#1149)
* Update Commands.md (#1148)
* fix: git-summary commit count (#1147)
* tests: update dependencies (#1142)
* chore(deps): bump masesgroup/retrieve-changed-files from 2 to 3 (#1144)
* chore(deps): bump actions/setup-go from 4 to 5 (#1143)
* ci: add dependabot update for GitHub actions (#1141)
* ci: update actions (#1140)
* Bump version to 7.3.0-dev (#1139)
7.2.0 / 2024-04-21
==================
* refactor: test utils and simplify the case code (#1136)
* Add --proceed flag to git-delete-squashed-branches (#1134) (#1135)
* test(browse-ci): add unit tests (#1130)
* test(git-browse): add unit tests (#1127)
* feat: add reverse option to git-brv (#1123)
* fix(utimes): change /dev/stdin to -
* fix(utimes): Support filenames with backspaces, etc. (#1122)
* chore: add poetry to handle the tests of the git extras (#1121)
* Fix typo in ci.yml (#1120)
* Fix: harden utimes, use single quotes (#1109)
* Fix: patch git-utimes (fixes #1118) (#1119)
* add pull request manner (#1113)
* maintenance: Add my name as maintainer in AUTHORS (#1117)
* test(git-authors): add unit test (#1098)
* Add more comprensive dependencies (#1111)
* fix: git-standup find error (tj#1106) (#1110)
* Improve defaults for testing suite (#1104)
* feat: Speed up utimes (#1108)
* Overhaul CONTRIBUTING document (#1103)
* Bump version to 7.2.0-dev (#1099)
7.1.0 / 2023-10-28
==================
* git-cp: don't stop execution when merge.ff is not set (#1096)
* Allow `git cp` to create destination folder automatically (#1091)
* fix: Use `-iname` and expressions instead of `-iregex` (#1094)
* change installation source from master to main (#1092)
* test(git-archive-file): add unit test (#1084)
* ci: Use Go v1.20 for running `editorconfig-checker` (#1086)
* test(git-alias): add its unit test (#1077)
* makefile: Allow bypassing conflict check (#1080)
* fix: Restore zsh completions to working completion (#1079)
* fix: add missing quote in git-extras-completion.zsh (#1078)
* feat: Implement completion for `git coauthor` (#1074)
* fix: Move improvements via ShellCheck (#1075)
* feat(auto-test): CI with pytest (#1066)
* git-feature: add configurable branch separator (#1072)
* git-psykorebase: determine branch names with bash pattern substitution (#1073)
* git-cp: continue to merge when merge.ff is only (#1070)
* git archive-file: change base ARCHIVE_NAME (#1071)
* readme: Add secondary location of screencast (#1065)
* fix: Improve Bash hygiene (#1056)
* feat: Implement `git-get` command (#1045)
* Corrected grammar in bin/git-cp (#1061)
* Improve `git-ignore` command (#1047)
* I have made two improvements to the git-bulk: (#1054)
* Type properly `__gitex_command_successful` calls and capitalizate github to GitHub (#1049)
* Add typo checker
* Fix comment typo in git-authors (#1050)
* tweak: Fix typos (#1046)
* Makefile: init SYSCONFDIR before using it (#1044)
* Makefile: tune MANPREFIX configuration for FreeBSD (#1043)
* Makefile: set bash COMPL_DIR to FreeBSD expected defaults (#1042)
* Bump version to 7.1.0-dev (#1041)
7.0.0 / 2023-04-20
==================

View file

@ -1,14 +1,20 @@
# Installing git-extras
# Installation
## Dependencies
Some commands require extra dependencies which are unavailable in some platforms.
You may need to install them manually.
You may need to install them manually. They are:
Those dependencies are listed below:
* column
* bash 4.0+
* Git 2.17+
* `column`
* `awk`
* `find`
* `tput`
* cURL (only required for `git-fork`, `git-ignore-io`, `git-pull-request`)
* `ps` (only required for `git-changelog`)
* `rsync` (only required for `git-rscp`, `git-scp`)
* `xargs` (only required for `git-delete-merged-branches`, `git-force-clone`, `git-sed`, `git-scp`)
If `bash --version` shows a lower version, you need to update it.
For example, the default bash in Mac is usually too old and you may need to update it via `brew install bash`.
@ -35,9 +41,10 @@ $ sudo dnf install git-extras
### openSUSE
Substitute your openSUSE version in the command below (in this case we are considering openSUSE Leap 15.2):
Substitute your openSUSE version in the command below (in this case we are considering openSUSE Leap 15.6):
```bash
$ sudo zypper ar https://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_Leap_15.2/devel:tools:scm.repo
$ sudo zypper ar https://download.opensuse.org/repositories/devel:/tools:/scm/15.6/devel:tools:scm.repo
```
and install it:
@ -68,7 +75,6 @@ $ nix-env -i git-extras
[Abdullah](https://github.com/AWAN) has written a [Pkgfile](https://abdullah.today/ports/git-extras/Pkgfile) for his beloved [distro](https://crux.nu).
### Homebrew
```bash
@ -77,7 +83,6 @@ $ brew install git-extras
Installing from Homebrew will not give you the option omit certain `git-extras` if they conflict with existing git aliases. To have this option, build from source.
### Arch Linux
* [git-extras](https://aur.archlinux.org/packages/git-extras/)
@ -87,6 +92,7 @@ Installing from Homebrew will not give you the option omit certain `git-extras`
First, please install `Git for Windows 2.x` from 'https://github.com/git-for-windows/git/releases'.
Second, clone the `git-extras` repo into any folder you like.
```bash
git clone https://github.com/tj/git-extras.git
# checkout the latest tag (optional)
@ -138,7 +144,7 @@ alternate location, specify a `PREFIX` when calling `make`.
```bash
# Non-root users can install under their home directory
make install PREFIX=$HOME/software
make install PREFIX=$HOME/.local
# For third-party software kept under /opt
make install PREFIX=/opt
@ -148,7 +154,7 @@ If you want to relocate the bulk of the installation but still have configuratio
files installed to the system `/etc` dir or other alternate location, you can
specify `SYSCONFDIR` in addition to `PREFIX`.
```
```sh
$ sudo make install PREFIX=/usr/local SYSCONFDIR=/etc
```
@ -159,12 +165,13 @@ See the Makefile for details on advanced configuration options.
One-liner:
```bash
curl -sSL https://raw.githubusercontent.com/tj/git-extras/master/install.sh | sudo bash /dev/stdin
curl -sSL https://raw.githubusercontent.com/tj/git-extras/main/install.sh | sudo bash /dev/stdin
```
## Installing as Zsh plugin
[ZInit](https://github.com/zdharma/zinit) can install git-extras by using:
```zsh
zinit ice as"program" pick"$ZPFX/bin/git-*" src"etc/git-extras-completion.zsh" make"PREFIX=$ZPFX"
zinit light tj/git-extras

View file

@ -1,20 +1,25 @@
PREFIX ?= /usr/local
BINPREFIX ?= "$(PREFIX)/bin"
SYSCONFDIR ?= $(PREFIX)/etc
SHELL := bash
OS = $(shell uname)
ifeq ($(OS), FreeBSD)
MANPREFIX ?= "$(PREFIX)/man/man1"
ifeq ($(MANPREFIX), /usr/local)
MANPREFIX = "/usr/local/man/man1"
endif
else
MANPREFIX ?= "$(PREFIX)/share/man/man1"
endif
ifeq ($(OS), Darwin)
COMPL_DIR ?= "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d"
else ifeq ($(OS), FreeBSD)
COMPL_DIR ?= "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d"
else
COMPL_DIR ?= "$(DESTDIR)$(SYSCONFDIR)/bash-completion/completions"
endif
SYSCONFDIR ?= $(PREFIX)/etc
BINS = $(wildcard bin/git-*)
MANS = $(wildcard man/git-*.md)
MAN_BINS = $(filter-out man/git-extras.md, $(MANS))
@ -40,22 +45,24 @@ install: check
@if [ "$(INSTALL_VIA)" = brew ]; then \
git apply brew-release.patch || { echo "Can't apply brew release patch"; exit 1; } \
fi
@mkdir -p $(DESTDIR)$(MANPREFIX)
@mkdir -p $(DESTDIR)$(BINPREFIX)
@echo "... installing bins to $(DESTDIR)$(BINPREFIX)"
@echo "... installing man pages to $(DESTDIR)$(MANPREFIX)"
mkdir -p $(DESTDIR)$(MANPREFIX)
mkdir -p $(DESTDIR)$(BINPREFIX)
@echo '... installing bins to '$(DESTDIR)$(BINPREFIX)
@echo '... installing man pages to '$(DESTDIR)$(MANPREFIX)
$(eval TEMPFILE := $(shell mktemp -q $${TMPDIR:-/tmp}/git-extras.XXXXXX 2>/dev/null || mktemp -q))
@# chmod from rw-------(default) to rwxrwxr-x, so that users can exec the scripts
@chmod 775 $(TEMPFILE)
$(eval EXISTED_ALIASES := $(shell \
git config --get-regexp 'alias.*' | awk '{print "git-" substr($$1, 7)}'))
git config --get-regexp 'alias\..*' | awk '{print "git-" substr($$1, 7)}'))
@$(foreach COMMAND, $(COMMANDS), \
disable=''; \
if test ! -z "$(filter $(COMMAND), $(EXISTED_ALIASES))"; then \
read -p "$(COMMAND) conflicts with an alias, still install it and disable the alias? [y/n]" answer; \
test "$$answer" = 'n' -o "$$answer" = 'N' && disable="true"; \
should_install='yes'; \
if [ ! -z "$(filter $(COMMAND), $(EXISTED_ALIASES))" ] && [ "$$SKIP_CONFLICT_CHECK" != yes ]; then \
read -p "$(COMMAND) conflicts with an alias, still install it? [y/n]: " answer; \
if [ "$$answer" = 'n' ] || [ "$$answer" = 'N' ]; then \
should_install="no"; \
fi; \
fi; \
if test -z "$$disable"; then \
if [ "$$should_install" = 'yes' ]; then \
echo "... installing $(COMMAND)"; \
head -1 bin/$(COMMAND) > $(TEMPFILE); \
cat $(LIB) >> $(TEMPFILE); \
@ -133,4 +140,7 @@ docclean:
rm -f man/*.1
rm -f man/*.html
.PHONY: default docs clean docclean check install uninstall
test:
bats ./tests
.PHONY: default docs check install uninstall clean docclean test

View file

@ -6,15 +6,15 @@ Little git extras.
Just getting started? Check out these screencasts:
* [introduction](https://vimeo.com/45506445) -- covering git-ignore, git-setup, git-changelog, git-release, git-effort and more
* [introduction](https://vimeo.com/45506445) ([archive.org link](https://web.archive.org/web/20230219181235id_/vod-progressive.akamaized.net/exp=1676834145~acl=%2Fvimeo-prod-skyfire-std-us%2F01%2F4101%2F1%2F45506445%2F107111328.mp4~hmac=065b68f23c4b6a222463097b36d1c346995a9559baa9b819972da95550018471/vimeo-prod-skyfire-std-us/01/4101/1/45506445/107111328.mp4)) -- covers `git-ignore`, `git-setup`, `git-changelog`, `git-release`, `git-effort` and more
## Installation
See [Installation](Installation.md) page.
See the [Installation](Installation.md) page.
## Commands
Go to [Commands](Commands.md) page for basic usage and examples.
Go to the [Commands](Commands.md) page for basic usage and examples.
__GIT utilities__ -- repo summary, repl, changelog population, author commit percentages and more
@ -27,8 +27,8 @@ Please read [Contributing](CONTRIBUTING.md) before you make a PR, thanks!
## The change of the default branch
As of Git Extras 6.4 the assumed default branch name changed from `master` to `main`.
This affects the Git Extras commands `git archive-file`, `git delete-merged-branches`, `git delta`, `git pull-request`, `git show-merged-branches`, `git show-unmerged-branches` and `git squash`.
This affects the Git Extras commands `git archive-file`, `git delete-merged-branches`, `git delta`, `git pull-request`, `git show-merged-branches`, `git show-unmerged-branches`, and `git squash`.
To change the default branch name to `master`: change either the configuration `git-extras.default-branch` or `init.defaultBranch` to `master`, the former takes precedence.
To change the default branch name to `master`: change either the configuration `git-extras.default-branch` or `init.defaultBranch` to `master`; the former takes precedence.
For example, `git config git-extras.default-branch master`
For example, `git config git-extras.default-branch master`.

View file

@ -1,17 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail
# git rev-parse emits an error if not in a git repo so only need to bail out
gitdir="$(git rev-parse --git-dir)" || exit
opfound=
fcnt=
for i in cherry-pick merge rebase revert; do
f=${i^^}
f=${f/-/_}
test -f "${gitdir}/${f}_HEAD" && fcnt=1$fcnt && opfound=$i
done
if [ "${fcnt}" != 1 ]; then
echo "I don't know what to abort" >&2
exit 1
fi
discover_op() {
local op
for op in cherry_pick merge rebase revert ; do
if [ -f "${gitdir}/${op^^}_HEAD" ]; then
echo "${op/_/-}"
fi
done
}
git "${opfound}" --abort
validate_op() {
local op="$1"
if [ -z "$op" ]; then
echo "No active operation found" >&2
exit 1
fi
if [[ "$(echo "$op" | wc -l)" -gt 1 ]]; then
echo "Multiple active operations found:" >&2
for o in $op; do
echo " - $o: HEAD: $(cat "${gitdir}/${o}_HEAD")" >&2
done
exit 1
fi
}
discover_action() {
local action=${1/git-/}
if [ "$action" != "abort" ] && [ "$action" != "continue" ]; then
echo "Invalid action: $1" >&2
exit 1
fi
echo "$action"
}
action=$(discover_action "$(basename "$0")")
op=$(discover_op)
validate_op "$op"
git "$op" "--$action"

View file

@ -1,16 +1,45 @@
#!/usr/bin/env bash
options=""
usage() {
cat <<HERE
usage: git alias # list all aliases
or: git alias <search-pattern> # show aliases matching pattern
or: git alias <alias-name> <command> # alias a command
usage: git alias [options] # list all aliases
or: git alias [options] <search-pattern> # show aliases matching pattern
or: git alias [options] <alias-name> <command> # alias a command
options:
--global Show or create alias in the system config
--local Show or create alias in the repository config
HERE
}
if [[ "$1" == "--local" || "$1" == "--global" ]]; then
options=$1
shift
fi
case $# in
0) git config --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort ;;
1) git alias | grep -e "$1" ;;
2) git config --global alias."$1" "$2" ;;
0)
if [[ -z "$options" ]]; then
git config --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort
else
git config "$options" --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort
fi
;;
1)
if [[ -z "$options" ]]; then
git config --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort | grep -e "$1"
else
git config "$options" --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort | grep -e "$1"
fi
;;
2)
if [[ -z "$options" ]]; then
git config alias."$1" "$2"
else
git config "$options" alias."$1" "$2"
fi
;;
*) >&2 echo "error: too many arguments." && usage && exit 1 ;;
esac

View file

@ -1,11 +1,11 @@
#!/usr/bin/env bash
# extract current branch name
BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
# get name of the most top folder of current directory, used for the
# output filename
ARCHIVE_NAME=$(basename "$PWD")
ARCHIVE_NAME=$(basename "$(git rev-parse --show-toplevel)")
if [[ $BRANCH = tags* ]]; then
BRANCH=$(git describe)

View file

@ -3,7 +3,6 @@
LIST=false
NO_EMAIL=false
FILE=""
EDITOR=$(git var GIT_EDITOR)
while [[ $# -gt 0 ]]; do
case $1 in
@ -22,9 +21,9 @@ done
if ! $LIST; then
FILE=$1
if test "$FILE" = ""; then
FILE=$(ls | grep -E 'authors|contributors' -i|head -n1)
if test "$FILE" = ""; then
if [ -z "$FILE" ]; then
FILE=$(find . -mindepth 1 -maxdepth 1 \( -iname '*authors*' -o -iname '*contributors*' \) | head -n1)
if [ -z "$FILE" ]; then
FILE='AUTHORS'
fi
fi
@ -36,11 +35,11 @@ fi
authors() {
if $NO_EMAIL; then
# eamil will be used to uniq authors.
git shortlog -sne | awk '{$1=""; sub(" ", ""); print}' | awk -F'<' '!x[$1]++' | awk -F'<' '!x[$2]++' \
# email will be used to uniq authors.
git shortlog HEAD -sne | awk '{$1=""; sub(" ", ""); print}' | awk -F'<' '!x[$1]++' | awk -F'<' '!x[$2]++' \
| awk -F'<' '{gsub(/ +$/, "", $1); print $1}'
else
git shortlog -sne | awk '{$1=""; sub(" ", ""); print}' | awk -F'<' '!x[$1]++' | awk -F'<' '!x[$2]++'
git shortlog HEAD -sne | awk '{$1=""; sub(" ", ""); print}' | awk -F'<' '!x[$1]++' | awk -F'<' '!x[$2]++'
fi
}
@ -52,5 +51,4 @@ if $LIST; then
authors
else
authors >> "$FILE"
test -n "$EDITOR" && $EDITOR "$FILE"
fi

View file

@ -7,6 +7,20 @@ if ! (( BASH_VERSINFO[0] > 4 ||
exit 1
fi
# allow the user to set a default reverse option in an environment variable
reverse=$(git config --get git-extras.brv.reverse || echo false)
while [[ $# -gt 0 ]]; do
case $1 in
-r | --reverse)
reverse=true
shift
;;
*)
break
;;
esac
done
if [[ -t 1 ]]; then
shopt -s checkwinsize
COLUMNS=$(tput cols)
@ -36,9 +50,14 @@ for b in "${!upstream[@]}"; do
done
mapfile -t ordered < <(
# the reverse option of git-brv causes the sort to be sorted normally rather than in reverse
reverse_opt=""
if [[ $reverse = false ]]; then
reverse_opt="-r"
fi
for b in "${!date[@]}"; do
printf '%d\t%s\n' "${date[$b]}" "$b"
done | sort -rn | cut -f2-
done | sort -n $reverse_opt | cut -f2-
)
current=$(git symbolic-ref -q --short HEAD)

View file

@ -9,12 +9,14 @@ guardedmode=false
singlemode=false
allwsmode=false
quiet=false
no_follow_symlinks=false
no_follow_hidden=false
#
# print usage message
#
usage() {
echo 1>&2 "usage: git bulk [-q|--quiet] [-g] ([-a]|[-w <ws-name>]) <git command>"
echo 1>&2 "usage: git bulk [--no-follow-symlinks] [--no-follow-hidden] [-q|--quiet] [-g] ([-a]|[-w <ws-name>]) <git command>"
echo 1>&2 " git bulk --addworkspace <ws-name> <ws-root-directory> (--from <URL or file>)"
echo 1>&2 " git bulk --removeworkspace <ws-name>"
echo 1>&2 " git bulk --addcurrent <ws-name>"
@ -22,22 +24,33 @@ usage() {
echo 1>&2 " git bulk --listall"
}
cdfail() {
echo 1>&2 "failed to change directory: $1"
exit 1
}
# add another workspace to global git config
function addworkspace {
git config --global bulkworkspaces."$wsname" "$wsdir";
if [ -n "$source" ]; then
addworkspace() {
git config --global bulkworkspaces."$wsname" "$wsdir";
if [ -n "$source" ]; then
if [ ! -d "$wsdir" ]; then echo 1>&2 "Path of workspace doesn't exist, make it first."; exit 1; fi
regex='http(s)?://|ssh://|(git@)?.*:.*/.*'
if [[ "$source" =~ $regex ]]; then
pushd "$wsdir" > /dev/null
pushd "$wsdir" > /dev/null || cdfail "$wsdir"
git clone "$source"
popd > /dev/null
popd > /dev/null || cdfail "$OLDPWD"
else
source=$(realpath "$source" 2>/dev/null)
if [ -f "$source" ]; then
pushd "$wsdir" > /dev/null
while read -r line; do git clone "$line"; done < "$source";
popd > /dev/null
pushd "$wsdir" > /dev/null || cdfail "$wsdir"
while IFS= read -r line; do
if [ -n "$line" ]; then
# the git clone command to take the complete line in the repository.txt as separate argument. This facilitated the cloning of the repository with a custom folder name.
# shellcheck disable=SC2086
git clone $line;
fi
done < "$source"
popd > /dev/null || cdfail "$OLDPWD"
else
echo 1>&2 "format of URL or file unknown"
fi
@ -46,19 +59,19 @@ function addworkspace {
}
# add current directory
function addcurrent { git config --global bulkworkspaces."$wsname" "$PWD"; }
addcurrent() { git config --global bulkworkspaces."$wsname" "$PWD"; }
# remove workspace from global git config
function removeworkspace { checkWSName && git config --global --unset bulkworkspaces."$wsname"; }
removeworkspace() { checkWSName && git config --global --unset bulkworkspaces."$wsname"; }
# remove workspace from global git config
function purge { git config --global --remove-section bulkworkspaces; }
purge() { git config --global --remove-section bulkworkspaces; }
# list all current workspace locations defined
function listall { git config --global --get-regexp bulkworkspaces; }
listall() { git config --global --get-regexp bulkworkspaces; }
# guarded execution of a git command in one specific repository
function guardedExecution () {
guardedExecution () {
if [ "${quiet?}" != "true" ] || $guardedmode; then
echo 1>&2 "${bldred}->${reset} executing ${inverse}git $gitcommand${reset} in repository ${leadingpath%/*}/${bldred}${curdir##*/}${reset}"
fi
@ -75,7 +88,7 @@ function guardedExecution () {
}
# check if the passed command is known as a core git command
function checkGitCommand () {
checkGitCommand () {
if git help -a | grep -o -q "\b${corecommand}\b"; then
echo 1>&2 "Core command \"$corecommand\" accepted."
else
@ -88,7 +101,7 @@ function checkGitCommand () {
}
# check if workspace name is registered
function checkWSName () {
checkWSName () {
while read -r workspace; do
parseWsName "$workspace"
if [[ $rwsname == "$wsname" ]]; then return; fi
@ -98,14 +111,24 @@ function checkWSName () {
}
# parse out wsname from workspacespec
function parseWsName () {
parseWsName () {
local wsspec="$1"
# Get the workspace value from its specification in the `.gitconfig`.
# May be an absolute path or a variable name of the form: `$VARNAME`
rwsdir=${wsspec#* }
if [[ ${rwsdir:0:1} == '$' ]]; then
# Dereference the `rwsdir` value which is a variable name.
rwsdir_varname=${rwsdir:1}
rwsdir=${!rwsdir_varname}
if [[ -z "${rwsdir}" ]]; then
echo 1>&2 "error: bad environment variable: $rwsdir_varname" && exit 1
fi
fi
rwsname=${wsspec#*.} && rwsname=${rwsname%% *}
}
# detects the wsname of the current directory
function wsnameToCurrent () {
wsnameToCurrent () {
while read -r workspace; do
if [ -z "$workspace" ]; then continue; fi
parseWsName "$workspace"
@ -117,33 +140,44 @@ function wsnameToCurrent () {
}
# helper to check number of arguments.
function allowedargcount () {
if [ "$paramcount" -ne "$1" ] && [ "$paramcount" -ne "$2" ]; then
allowedargcount () {
if [ "$paramcount" -ne "${1:-0}" ] && [ "$paramcount" -ne "${2:-0}" ]; then
echo 1>&2 "error: wrong number of arguments" && usage;
exit 1;
fi
}
# execute the bulk operation
function executBulkOp () {
executBulkOp () {
checkGitCommand
if ! $allwsmode && ! $singlemode; then wsnameToCurrent; fi # by default git bulk works within the 'current' workspace
listall | while read -r workspacespec; do
parseWsName "$workspacespec"
if [[ -n $wsname ]] && [[ $rwsname != "$wsname" ]]; then continue; fi
eval cd "\"$rwsdir\""
cd "$rwsdir" || exit 1
local actual=$PWD
[ "${quiet?}" != "true" ] && echo 1>&2 "Executing bulk operation in workspace ${inverse}$actual${reset}"
allGitFolders=( $(eval find -L . -name ".git") )
# build `find` flags depending on command-line options
local find_flags=()
if [[ "$no_follow_symlinks" == true ]]; then
find_flags+=(-P)
else
find_flags+=(-L)
fi
# find all git repositories under the workspace on which we want to operate
readarray allGitFolders < <(find "${find_flags[@]}" . -name ".git" 2>/dev/null)
for line in "${allGitFolders[@]}"; do
local gitrepodir=${line::${#line}-5} # cut the .git part of find results to have the root git directory of that repository
eval cd "\"$gitrepodir\"" # into git repo location
cd "$gitrepodir" || exit 1 # into git repo location
local curdir=$PWD
local leadingpath=${curdir#"${actual}"}
guardedExecution "$@"
eval cd "\"$rwsdir\"" # back to origin location of last find command
# do not execute if we do not want to consider a ".git" directory under a hidden directory
if [ $no_follow_hidden = false ] || ! [[ "$leadingpath" =~ "/." ]]; then
guardedExecution "$@"
fi
cd "$rwsdir" || exit 1 # back to origin location of last find command
done
done
}
@ -160,7 +194,11 @@ while [ "${#}" -ge 1 ] ; do
--listall|--purge)
butilcommand="${1:2}" && break ;;
--removeworkspace|--addcurrent|--addworkspace)
butilcommand="${1:2}" && wsname="$2" && wsdir="$3" && if [ "$4" == "--from" ]; then source="$5"; fi && break ;;
butilcommand="${1:2}" && wsname="$2" && wsdir="$3" && if [ "$4" = "--from" ]; then source="$5"; fi && break ;;
--no-follow-symlinks)
no_follow_symlinks=true ;;
--no-follow-hidden)
no_follow_hidden=true ;;
-a)
allwsmode=true ;;
-g)

View file

@ -9,6 +9,15 @@ GIT_MERGELOG_FORMAT="$(git config changelog.mergeformat)"
GIT_EDITOR="$(git var GIT_EDITOR)"
PROGNAME="git-changelog"
git_editor() {
if test -z "${GIT_EDITOR:+set}"
then
GIT_EDITOR="$(git var GIT_EDITOR)" || return $?
fi
eval "$GIT_EDITOR" '"$@"'
}
_usage() {
cat << EOF
usage: $PROGNAME options [file]
@ -146,6 +155,8 @@ _fetchCommitRange() {
local start_tag="$2"
local final_tag="$3"
# This shellcheck disable is applied to the whole if-body
# shellcheck disable=SC2086
if [[ "$list_all" == true ]]; then
git log $GIT_LOG_OPTS --pretty=format:"${CUR_GIT_LOG_FORMAT}"
elif [[ -n "$final_tag" && "$start_tag" == "null" ]]; then
@ -280,7 +291,8 @@ commitList() {
for (( i=0; i<"${_tags_list_keys_length}"; i++ )); do
local __curr_tag="${tags_list_keys[$i]}"
local __prev_tag="${tags_list_keys[$i+1]:-null}"
local __curr_date="$(_valueForKeyFakeAssocArray "${__curr_tag}" "${tags_list[*]}")"
local __curr_date
__curr_date="$(_valueForKeyFakeAssocArray "${__curr_tag}" "${tags_list[*]}")"
__curr_date="${__curr_date##*=>}"
# output latest commits, up until the most-recent tag, these are all
@ -528,9 +540,10 @@ main() {
#
# generate changelog
#
local tmpfile="$(git_extra_mktemp)"
local changelog="$(_valueForKeyFakeAssocArray "output_file" "${option[*]}")"
local title_tag="$(_valueForKeyFakeAssocArray "title_tag" "${option[*]}")"
local tmpfile changelog title_tag
tmpfile="$(git_extra_mktemp)"
changelog="$(_valueForKeyFakeAssocArray "output_file" "${option[*]}")"
title_tag="$(_valueForKeyFakeAssocArray "title_tag" "${option[*]}")"
if [[ "$(_valueForKeyFakeAssocArray "list_style" "${option[*]}")" == true ]]; then
if [[ "$(_valueForKeyFakeAssocArray "list_all" "${option[*]}")" == true ]]; then
@ -549,7 +562,7 @@ main() {
fi
if [[ -z "$changelog" ]]; then
changelog="$(ls | grep -E 'change|history' -i | head -n1)"
changelog="$(find . -mindepth 1 -maxdepth 1 \( -iname '*change*' -o -iname '*history*' \) | head -n1)"
if [[ -z "$changelog" ]]; then
changelog="History.md";
fi
@ -570,7 +583,7 @@ main() {
rm -f "$tmpfile"
if [[ -n "$GIT_EDITOR" ]]; then
$GIT_EDITOR "$changelog" || _exit
git_editor "$changelog" || _exit
else
less "$changelog" || _exit
fi

View file

@ -2,7 +2,7 @@
PROGNAME="git-clear"
FORCE=0
function _usage() {
_usage() {
cat << EOF
usage: $PROGNAME options
usage: $PROGNAME -h|help|?
@ -32,12 +32,12 @@ done
# Only wait for answer if not forced by user
if [[ $FORCE == 0 ]]; then
echo -n "Sure? - This command may delete files that cannot be recovered, including those in .gitignore [y/N]: "
echo -n "Sure? - THIS COMMAND MAY DELETE FILES THAT CANNOT BE RECOVERED, including those in .gitignore [y/N]: "
read -r clean
else
clean=y
fi
if [ "$clean" == "y" ]; then
if [ "$clean" = "y" ]; then
git clean -d -f -x && git reset --hard
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
echo -n "Sure? - This command may delete files that cannot be recovered. Files and directories in .gitignore will be preserved [y/N]: "
read -r ans
if [ "$ans" == "y" ]
read -r answer
if [ "$answer" = "y" ]
then git clean -d -f && git reset --hard
fi

View file

@ -1,6 +1,36 @@
#!/usr/bin/env bash
SINCE="last week"
test $# -ne 0 && SINCE=$*
echo "... commits since $SINCE" >&2
git log --pretty='%an - %s' --after="@{$SINCE}"
REF=""
SINCE=""
while [[ $# -gt 0 ]]; do
case "$1" in
-r|--ref)
if [[ -z "$2" ]]; then
echo "error: option $1 requires an argument" >&2
exit 1
fi
REF="$2"
shift
shift
;;
*)
# non-flag args accumulation, e.g. "last " + "week" -> "last week"
SINCE="${SINCE:+$SINCE }$1"
shift
;;
esac
done
if [[ -n "$REF" && -n "$SINCE" ]]; then
echo "error: '--ref <ref>' and '<date>' are mutually exclusive" >&2
exit 1
fi
SINCE="${SINCE:-last week}"
if [[ -n "$REF" ]]; then
git log --pretty='%h %an - %s' "$REF..HEAD"
else
git log --pretty='%h %an - %s' --after="@{$SINCE}"
fi

1
bin/git-continue Symbolic link
View file

@ -0,0 +1 @@
git-abort

View file

@ -38,30 +38,41 @@ else
exit 40
fi
echo "Coping $CURRENT_FILENAME into $DESTINATION_FILENAME"
if [[ "$DESTINATION_FILENAME" == */ ]]; then
echo 1>&2 "$DESTINATION_FILENAME is not a file path."
exit 80
fi
if [[ "$DESTINATION_FILENAME" == */* ]]; then
DESTINATION_DIR="${DESTINATION_FILENAME%/*}"
if ! mkdir -p "$DESTINATION_DIR"; then
echo 1>&2 "Failed to create destination directory: $DESTINATION_DIR"
exit 160
fi
fi
INTERMEDIATE_FILENAME="${CURRENT_FILENAME//\//__}-move-to-${DESTINATION_FILENAME//\//__}"
# We keep the existing file on the side in a commit
git mv "${CURRENT_FILENAME}" "${INTERMEDIATE_FILENAME}"
git commit -nm "Keep $CURRENT_FILENAME"
echo "Copying $CURRENT_FILENAME into $DESTINATION_FILENAME"
# We come back to the previous state and revert that change
INTERMEDIATE_SAVED=$(git rev-parse HEAD)
git reset --hard HEAD^
# Pre-check that the source and destination will work
git mv --dry-run "${CURRENT_FILENAME}" "${DESTINATION_FILENAME}"
# We move the file to its new destination
# Make a new branch and switch to it
BRANCH_NAME="git-cp-$(date +%s)"
git checkout -b "$BRANCH_NAME"
# Move the original file to the new destination, in this branch
git mv "${CURRENT_FILENAME}" "${DESTINATION_FILENAME}"
git commit -nm "Copy $CURRENT_FILENAME into $DESTINATION_FILENAME"
git commit -nm "--Duplicate $CURRENT_FILENAME history into $DESTINATION_FILENAME"
# We come back to the previous state and revert that change again
DESTINATION_SAVED=$(git rev-parse HEAD)
git reset --hard HEAD^
# Restore the original file to keep it in the history
git checkout HEAD~ "${CURRENT_FILENAME}"
git commit -nm "--Restore $CURRENT_FILENAME"
# We keep both files
git merge "${DESTINATION_SAVED}" "${INTERMEDIATE_SAVED}" -m "Duplicate ${CURRENT_FILENAME} history."
# Switch to the original branch and merge this back in.
git checkout -
git merge --no-ff "$BRANCH_NAME" -m "Copy $CURRENT_FILENAME into $DESTINATION_FILENAME"
# We get back our original name
git mv "${INTERMEDIATE_FILENAME}" "${CURRENT_FILENAME}"
git commit -nm "Set back ${CURRENT_FILENAME} file"
# We're now done with the branch, so delete it.
# We shouldn't need -D here, as we've already merged it back in.
git branch -d "$BRANCH_NAME"
fi

View file

@ -39,7 +39,7 @@ then
REMOTE=origin
fi
test -z $BRANCH && echo "branch argument required." 1>&2 && exit 1
test -z "$BRANCH" && echo "branch argument required." 1>&2 && exit 1
if [[ -n $REMOTE ]]
then

60
bin/git-delete-gone-branches Executable file
View file

@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail
dry_run=false
force=false
prune=false
while [[ $# -gt 0 ]]; do
case "$1" in
-n|--dry-run)
dry_run=true
shift
;;
-f|--force)
force=true
shift
;;
-p|--prune)
prune=true
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: git delete-gone-branches [-n|--dry-run] [-f|--force] [-p|--prune]"
exit 1
;;
esac
done
if [ "$prune" = true ]; then
git fetch --prune
fi
gone_branches=$(git for-each-ref --format \
'%(if:equals=gone)%(upstream:track,nobracket)%(then)%(refname:short)%(end)' refs/heads/ | sed '/^$/d')
if [ -z "$gone_branches" ]; then
echo "No branches with a gone remote found."
exit 0
fi
if [ "$dry_run" = true ]; then
echo "Would delete the following branches:"
echo "$gone_branches"
exit 0
fi
echo "The following branches will be deleted:"
echo "$gone_branches"
if [ "$force" = false ]; then
read -r -p "Delete these branches? [y/N] " confirm
if [[ ! "$confirm" =~ ^[yY]$ ]]; then
echo "Aborted."
exit 0
fi
fi
echo "$gone_branches" | xargs git branch -D

View file

@ -3,5 +3,5 @@
branches=$(git branch --no-color --merged | grep -vE "^(\*|\+)" | grep -v "$(git_extra_default_branch)" | grep -v svn)
if [ -n "$branches" ]
then
echo "$branches" | xargs -n 1 git branch -d
echo "$branches" | xargs git branch -d
fi

View file

@ -2,6 +2,12 @@
set -euo pipefail
proceed=false
if [[ $# -gt 0 && ("$1" == "--proceed" || "$1" == "-p") ]]; then
proceed=true
shift
fi
if [[ $# -eq 0 ]]; then
targetBranch=$(git rev-parse --abbrev-ref HEAD)
else
@ -13,6 +19,10 @@ git for-each-ref refs/heads/ "--format=%(refname:short)" | while read -r branch;
mergeBase=$(git merge-base "$targetBranch" "$branch")
if [[ $(git cherry "$targetBranch" "$(git commit-tree "$(git rev-parse "$branch^{tree}")" -p "$mergeBase" -m _)") == "-"* ]]; then
git branch -D "$branch"
if [[ $proceed == true ]]; then
git branch -D "$branch" || true
else
git branch -D "$branch"
fi
fi
done

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
VERSION="7.0.0"
INSTALL_SCRIPT="https://raw.githubusercontent.com/tj/git-extras/master/install.sh"
VERSION="7.6.0-dev"
INSTALL_SCRIPT="https://raw.githubusercontent.com/tj/git-extras/main/install.sh"
update() {
local bin="$(command -v git-extras)"

View file

@ -6,22 +6,30 @@ if [ -z "$branch_prefix" ]; then
branch_prefix="feature"
fi
branch_separator=$(git config --get git-extras.feature.separator)
if [ -z "$branch_separator" ]; then
branch_separator="/"
fi
merge_mode="--no-ff"
finish=false
declare -a argv
while test $# != 0
do
case $1 in
-a|--alias )
if [[ -n $2 ]]
if [[ -n $2 ]] && [[ $2 != -- ]]
then
shift # shift -a|-alias
branch_prefix=$1
else
argv+=("$1") # treat tail '-a' as <name>
echo >&2 "option $1 requires a value"
exit 1
fi
;;
-r|--remote )
if [[ -n $2 ]]
if [[ -n $2 ]] && [[ $2 != -- ]]
then
remote=$2
shift
@ -29,6 +37,16 @@ do
remote="origin"
fi
;;
-s|--separator )
if [[ -n $2 ]] && [[ $2 != -- ]]
then
branch_separator=$2
shift
else
echo >&2 "option $1 requires a value"
exit 1
fi
;;
--squash )
merge_mode="--squash"
;;
@ -36,6 +54,15 @@ do
start_point=$2
shift
;;
-- )
# terminate argument parsing
shift
argv+=("$@")
break
;;
finish )
finish=true
;;
* )
argv+=("$1")
;;
@ -45,21 +72,17 @@ done
concatargs() {
str=$(IFS='-'; echo "$*")
branch="$branch_prefix"/$str
branch="$branch_prefix$branch_separator$str"
}
if test "${argv[0]}" = "finish"; then
test -z "${argv[1]}" && echo "$branch_prefix" "<name> required." 1>&2 && exit 1
branch="$branch_prefix"/"${argv[1]}"
test -z "${argv[0]}" && echo "$branch_prefix" "<name> required." 1>&2 && exit 1
concatargs "${argv[@]}"
if "${finish}"
then
git merge ${merge_mode} "$branch" && git delete-branch "$branch"
else
test -z "${argv[0]}" && echo "$branch_prefix" "<name> required." 1>&2 && exit 1
if test -n "${argv[1]}"; then
concatargs "${argv[@]}"
else
branch="$branch_prefix"/"${argv[0]}"
fi
if [[ -n $remote ]] && [[ -z $start_point ]]
then
git create-branch -r "$remote" "$branch"

View file

@ -91,7 +91,8 @@ main() {
git reset --hard "origin/${branch}"
# Delete all other branches
branches=$(git branch | grep -v \* | xargs)
# shellcheck disable=SC2063
branches=$(git branch | grep -v '*' | xargs)
if [ -n "${branches}" ]; then
git branch -D "${branches}"
fi

View file

@ -17,9 +17,9 @@ read -r user
# personal access token
# config name is github-personal-access-token '_' is not allowed in git config
github_personal_access_token=$(git config git-extras.github-personal-access-token)
github_personal_access_token=$(git config --default "$GITHUB_TOKEN" git-extras.github-personal-access-token)
test -z "$github_personal_access_token" && abort "git config git-extras.github-personal-access-token required"
test -z "$github_personal_access_token" && abort "GITHUB_TOKEN, or git config git-extras.github-personal-access-token required"
# extract owner + project from repo url
project=${url##*/}
@ -61,7 +61,7 @@ else
# clone forked repo into current dir
git clone "${remote_prefix}${user}/${project}.git" "$project"
# add reference to origin fork so can merge in upstream changes
cd "$project"
cd "$project" || exit
git remote add upstream "${remote_prefix}${owner}/${project}.git"
git fetch upstream
fi

40
bin/git-get Executable file
View file

@ -0,0 +1,40 @@
#!/usr/bin/env bash
_usage() {
printf '%s\n' "usage: ${0##*/} <url>
usage: ${0##*/} --help
Clone a repository in a particular directory."
}
if (( $# == 0 )); then
_usage
exit 0
fi
for arg; do
if [ "$arg" = '-h' ] || [ "$arg" = '--help' ]; then
_usage
exit 0
fi
done
url=$1
if ! shift; then
printf 'ERROR: Failed to shift' >&2
exit 1
fi
clone_path=$(git config --get git-extras.get.clone-path)
if [ -z "$clone_path" ]; then
printf 'ERROR: %s\n' "Git configuration key 'git-extras.get.clone-path' must be set to a directory to clone under" >&2
exit 1
fi
dirname=${url%/}
dirname=${dirname%.git}
dirname=${dirname##*/}
mkdir -p "$clone_path"
git clone "$url" "$clone_path/$dirname" "$@"

View file

@ -31,7 +31,7 @@ do
esac
done
cd "$(git-root)" # cd for git blame
cd "$(git-root)" || exit # cd for git blame
MERGED_LOG=$(git_extra_mktemp)
if [[ $EMAIL == '-e' ]]
then
@ -44,9 +44,11 @@ for file in $(git diff --name-only "$@")
do
test -n "$DEBUG" && echo "git blame $file"
# $1 - since $2 - until
# shellcheck disable=SC2086
git blame $NOT_WHITESPACE --line-porcelain "$1" -- "$file" 2> /dev/null |
LC_ALL=C sed -n "$PATTERN" | sort | uniq -c | LC_ALL=C sed 's/^\(.\)/- \1/' >> "$MERGED_LOG"
# if $2 not given, use current commit as "until"
# shellcheck disable=SC2086
git blame $NOT_WHITESPACE --line-porcelain "${2-@}" -- "$file" 2> /dev/null |
LC_ALL=C sed -n "$PATTERN" | sort | uniq -c | LC_ALL=C sed 's/^\(.\)/+ \1/' >> "$MERGED_LOG"
done
@ -71,7 +73,7 @@ END {
printf("%d %s\n", contributors[people], people)
}
}
}' $MERGED_LOG | sort -nr | # only gawk supports built-in sort function
}' "$MERGED_LOG" | sort -nr | # only gawk supports built-in sort function
while read -r line
do
people=${line#* }
@ -87,7 +89,7 @@ do
do
printf "+"
done
printf "(%s)" $num
printf "(%s)" "$num"
else
for (( i = 0; i < num; i++ ))
do
@ -103,7 +105,7 @@ do
do
printf "-"
done
printf "(%s)" $num
printf "(%s)" "$num"
else
for (( i = 0; i > num; i-- ))
do

View file

@ -1,8 +1,28 @@
#!/usr/bin/env bash
: ${GIT_DIR:=$(git rev-parse --git-dir)}
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
function show_contents {
# awk script that takes 2 input files. The first one is newline deilmeted
# string of patterns to look for, second one is the file to remove them from.
# outfile has to be passed with -v upon call and is the file result is
# written to.
read -r -d '' AWK_SCRIPT <<'EOF'
# process the first "file" (newline split argument list)
NR==FNR { a[b++]=$0; next; }
# process file
{
found=0;
for (i=0; i != b; i++) {
if (a[i] == $0) { found=1; }
}
if (found == 1) { print "... removing '"$0"'"; }
else { print $0 > outfile }
}
EOF
show_contents() {
local file="${2/#~/$HOME}"
if [ -f "$file" ]; then
echo "$1 gitignore: $2" && cat "$file"
@ -11,18 +31,41 @@ function show_contents {
fi
}
function global_ignore() {
git config --global core.excludesFile || \
([ -n "$XDG_CONFIG_HOME" ] && echo "$XDG_CONFIG_HOME/git/ignore") || \
echo "$HOME/.config/git/ignore"
cd_to_git_root() {
local error_level="$1"
if ! git rev-parse --git-dir &>/dev/null; then
if [ "$error_level" = '--warn' ]; then
echo "Warning: Not currently in a Git repository" >&2
elif [ "$error_level" = '--error' ]; then
echo "Error: Not currently in a Git repository" >&2
exit 1
fi
fi
local result=
if result=$(git rev-parse --show-toplevel 2>/dev/null); then
cd "$result" || exit
fi
}
function show_global {
global_ignore() {
if ! git config --global core.excludesFile 2>/dev/null; then
if [ -f "$HOME/.gitignore" ]; then
echo "$HOME/.gitignore"
else
echo "${XDG_CONFIG_HOME:-$HOME/.config}/git/ignore"
fi
fi
}
show_global() {
show_contents Global "$(global_ignore)"
}
function add_global {
local global_gitignore="$(global_ignore)"
add_global() {
local global_gitignore
global_gitignore="$(global_ignore)"
if [ -z "$global_gitignore" ]; then
echo "Can't find global .gitignore."
echo ""
@ -33,28 +76,28 @@ function add_global {
fi
}
function show_local {
cd "$(git root)"
show_local() {
cd_to_git_root --warn
show_contents Local .gitignore
}
function add_local {
cd "$(git root)"
add_local() {
cd_to_git_root --warn
add_patterns .gitignore "$@"
}
function show_private {
cd "$(git root)"
show_private() {
cd_to_git_root --error
show_contents Private "${GIT_DIR}/info/exclude"
}
function add_private {
cd "$(git root)"
add_private() {
cd_to_git_root --error
test -d "${GIT_DIR}/info" || mkdir -p "${GIT_DIR}/info"
add_patterns "${GIT_DIR}/info/exclude" "$@"
}
function add_patterns {
add_patterns() {
echo "Adding pattern(s) to: $1"
local file="${1/#~/$HOME}"
dir_name=$(dirname "$file")
@ -71,6 +114,66 @@ function add_patterns {
done
}
edit_file() {
local file="${2/#~/$HOME}"
if [ -f "$file" ]; then
echo "Editing $1 gitignore: ($2)" && eval "$(git var GIT_EDITOR) $(printf '%q' "$file")"
echo "Done."
else
echo "There is no $1 .gitignore yet." >&2
exit 1
fi
}
_usage() {
cat << EOF
Usage: git ignore [OPTION]... [PATTERN]...
Modify or display local global or private gitignore files.
OPTIONs set context (local, global, private) and action (display, add,
remove, edit). In case of collision, last flag overwrites preceding ones.
Defaults are: local context, action is display (see man git ignore for
more details).
Context examples:
local: .../repo/.gitignore
private: .../repo/.git/info/exclude
global: \$HOME/.gitignore
PATTERNs are the gitignore patterns as specified in git documentation.
Options:
-l, --local Set context to local gitignore
-g, --global Set context to global gitignore
-p, --private Set context to private gitignore
-e, --edit Set action to edit
-r, --remove Set action to remove
-h, --help Print this message
-- End of options delimiter
EOF
}
remove_patterns() {
declare -a args
local tmpfile
args=( "${@:3}" )
local file="${2/#~/$HOME}"
if [ -f "$file" ]; then
tmpfile="$(mktemp -q "${TMPDIR:-/tmp}"/git-extras-ignore.XXXXXX 2>/dev/null)"
echo "Removing patterns from $1 gitignore: $2"
awk -v outfile="$tmpfile" "${AWK_SCRIPT}"\
<(printf '%s\n' "${args[@]}") "$file"
cat "$tmpfile" > "$file"
rm "$tmpfile"
else
echo "There is no $1 .gitignore yet"
exit 1
fi
}
# can have only 1 action and 1 level, if conflicting flags are passed
# latter ones overwrite former
# sanity of args not tested (e.g. there should be no args if -e is supplied)
if test $# -eq 0; then
show_global
echo "---------------------------------"
@ -78,22 +181,105 @@ if test $# -eq 0; then
echo "---------------------------------"
show_private
else
case "$1" in
-l|--local)
test $# -gt 1 && add_local "${@:2}" && echo
show_local
;;
-g|--global)
test $# -gt 1 && add_global "${@:2}" && echo
show_global
;;
-p|--private)
test $# -gt 1 && add_private "${@:2}" && echo
show_private
;;
*)
add_local "$@"
;;
esac
fi
# parse flags and args
level="none"
action="none"
declare -a args
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
_usage
exit 0
;;
-l|--local)
level="local"
;;
-g|--global)
level="global"
;;
-p|--private)
level="private"
;;
-e|--edit)
action="edit"
;;
-r|--remove)
action="remove"
;;
--)
shift
args+=("$@")
break
;;
*)
args+=("$1")
;;
esac
shift
done
# compatible with previous version
if [ "$action" = "none" ]; then
case "$level" in
local)
test ${#args[@]} -ne 0 && add_local "${args[@]}" && echo
show_local
;;
global)
test ${#args[@]} -ne 0 && add_global "${args[@]}" && echo
show_global
;;
private)
test ${#args[@]} -ne 0 && add_private "${args[@]}" && echo
show_private
;;
none)
add_local "${args[@]}"
# maybe show_local here too?
;;
esac
exit 0
# open file in editor
elif [ "$action" = "edit" ]; then
case "$level" in
local|none)
cd_to_git_root --warn
edit_file 'local' .gitignore && echo
;;
global)
global_gitignore="$(global_ignore)"
edit_file global "$global_gitignore" && echo
;;
private)
cd_to_git_root --error
test -d "${GIT_DIR}/info" || mkdir -p "${GIT_DIR}/info"
edit_file private "${GIT_DIR}/info/exclude" && echo
;;
esac
exit 0
# remove entries
else
if [ ${#args[@]} -eq 0 ]; then
echo "Nothing to remove."
exit 0
fi
case "$level" in
local|none)
cd_to_git_root --warn
remove_patterns 'local' .gitignore "${args[@]}" && echo
show_local
;;
global)
global_gitignore="$(global_ignore)"
remove_patterns global "$global_gitignore" "${args[@]}" && echo
show_global
;;
private)
cd_to_git_root --error
remove_patterns private "${GIT_DIR}/info/exclude" "${args[@]}" && echo
show_private
;;
esac
exit 0
fi
fi

View file

@ -30,7 +30,7 @@ while getopts "m:eapfh" arg; do
PUSH=true
;;
f)
FORCE='-f'
FORCE='--force-with-lease'
;;
h)
echo "$USAGE"

View file

@ -18,7 +18,7 @@ then
git stash
fi
if [ "${!#}" == '--ff-only' ]; then
if [ "${!#}" = '--ff-only' ]; then
case $# in
2 ) # dest --ff
git push "$(git rev-parse --show-toplevel)" "$cur_branch":"$1";;

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
usage() {
echo 1>&2 "usage: git missing [<first branch>] <second branch> [<git log options>]"
echo 1>&2 "usage: git missing [<first branch>] <second branch> [<git log options>] [[--] <path>...]"
}
if [ "${#}" -lt 1 ]
@ -12,9 +12,20 @@ fi
declare -a git_log_args=()
declare -a branches=()
declare -a pathspec=()
declare parse_path=false
for arg in "$@" ; do
if [[ $parse_path == true ]]; then
pathspec+=("$@")
break
fi
case "$arg" in
--)
parse_path=true
;;
--*)
git_log_args+=( "$arg" )
;;
@ -38,4 +49,4 @@ else
exit 1
fi
git log "${git_log_args[@]}" "$firstbranch"..."$secondbranch" --format="%m %h %s" --left-right
git log "${git_log_args[@]}" "$firstbranch"..."$secondbranch" --format="%m %h %s" --left-right -- "${pathspec[@]}"

View file

@ -7,6 +7,8 @@ if [ -z "${1-}" ] ; then
exit 1
fi
remote_ref_kind=merge-requests
if test "$1" = "clean"; then
git for-each-ref refs/heads/mr/* --format='%(refname)' | while read -r ref; do
git branch -D "${ref#refs/heads/}"
@ -15,13 +17,19 @@ if test "$1" = "clean"; then
elif [[ $1 =~ ^(https?://[^/]+/(.+))/merge_requests/([0-9]+).*$ ]]; then
remote=${BASH_REMATCH[1]}.git
id=${BASH_REMATCH[3]}
elif [[ $1 =~ ^(https?://[^/]+/(.+))/pulls/([0-9]+).*$ ]]; then
# Forgejo/Codeberg pull request URL, e.g.
# https://codeberg.org/owner/repository/pulls/453
remote=${BASH_REMATCH[1]}.git
id=${BASH_REMATCH[3]}
remote_ref_kind=pull
else
id=$1
remote=${2:-origin}
fi
branch=mr/$id
remote_ref=refs/merge-requests/$id/head
remote_ref=refs/$remote_ref_kind/$id/head
git fetch -fu "$remote" "$remote_ref:$branch"
git checkout "$branch"
git config --local --replace "branch.$branch.merge" "$remote_ref"

View file

@ -9,15 +9,15 @@ do
file="$file"' '"$i"
shift
done
test -n "$*" && range="$*"
test -n "$*" && range=("$@")
test -z "$file" && echo "file required." 1>&2 && exit 1
if [ -z "$range" ]
if [ -z "${range[*]}" ]
then
git filter-branch -f --index-filter "git rm -r --cached ""$file"" --ignore-unmatch" \
--prune-empty --tag-name-filter cat -- --all
else
# don't quote $range so that we can forward multiple rev-list arguments
# $range is an array so that we can forward multiple rev-list arguments
git filter-branch -f --index-filter "git rm -r --cached ""$file"" --ignore-unmatch" \
--prune-empty --tag-name-filter cat -- $range
--prune-empty --tag-name-filter cat -- "${range[@]}"
fi

View file

@ -2,7 +2,7 @@
set -e
set -o pipefail
if ! command -v pastebinit >/dev/null 2>&1; then
if ! command -v pastebinit &>/dev/null; then
echo >&2 "To run 'git paste', you need to install pastebinit in your system"
exit 1
fi

View file

@ -5,7 +5,7 @@ SECONDARY_BRANCH=""
FF="--ff"
CONTINUE="no"
function current_branch() {
current_branch() {
git rev-parse --abbrev-ref HEAD
}
@ -50,15 +50,13 @@ fi
if [[ "$CONTINUE" == "yes" ]]; then
TARGET_BRANCH=$(current_branch)
set "$(echo "$TARGET_BRANCH" | sed -e "s/-rebased-on-top-of-/\n/g")"
if [[ $# != 2 ]]; then
SECONDARY_BRANCH=${TARGET_BRANCH%"-rebased-on-top-of-"*}
PRIMARY_BRANCH=${TARGET_BRANCH#*"-rebased-on-top-of-"}
if [[ "${SECONDARY_BRANCH}-rebased-on-top-of-${PRIMARY_BRANCH}" != $TARGET_BRANCH ]]; then
echo "Couldn't continue rebasing on ${TARGET_BRANCH}"
exit 30 # Impossible to detect PRIMARY_BRANCH AND SECONDARY_BRANCH
fi
SECONDARY_BRANCH=$1
PRIMARY_BRANCH=$2
echo "Continuing rebasing of $SECONDARY_BRANCH on top of $PRIMARY_BRANCH"
git commit || exit 51
git branch -d "${SECONDARY_BRANCH}" || exit 52
@ -73,10 +71,9 @@ else
git checkout "${PRIMARY_BRANCH}" || exit 41
git checkout -b "${TARGET_BRANCH}" || exit 42
git merge "${SECONDARY_BRANCH}" ${FF} \
-m "Psycho-rebased branch ${SECONDARY_BRANCH} on top of ${PRIMARY_BRANCH}"
if [[ $? == 0 ]]; then
if git merge "${SECONDARY_BRANCH}" ${FF} \
-m "Psycho-rebased branch ${SECONDARY_BRANCH} on top of ${PRIMARY_BRANCH}"; then
git branch -d "${SECONDARY_BRANCH}" || exit 43
git branch -m "${TARGET_BRANCH}" "${SECONDARY_BRANCH}" || exit 44
else

View file

@ -31,9 +31,9 @@ EOF
# personal access token
# config name is github-personal-access-token '_' is not allowed in git config
github_personal_access_token=$(git config git-extras.github-personal-access-token)
github_personal_access_token=$(git config --default "$GITHUB_TOKEN" git-extras.github-personal-access-token)
test -z "$github_personal_access_token" && abort "git config git-extras.github-personal-access-token required"
test -z "$github_personal_access_token" && abort "GITHUB_TOKEN or git config git-extras.github-personal-access-token required"
# branch
@ -43,7 +43,7 @@ if [ -z "$remote" ]; then
echo 'no upstream found, push to origin as default'
remote="origin"
fi
[ "$remote" == "." ] && abort "the upstream should be a remote branch."
[ "$remote" = "." ] && abort "the upstream should be a remote branch."
# make sure it's pushed

View file

@ -20,7 +20,7 @@ cleanup() {
rm "$index"
exit 2
}
trap cleanup 2
trap cleanup INT
# Go back in history while parent commits are available.
echo "Trying to find a commit the patch applies to..."
@ -30,7 +30,7 @@ do
GIT_INDEX_FILE=$index git read-tree "$rev"
# Try to apply the patch.
GIT_INDEX_FILE=$index git apply --cached "$1" >/dev/null 2>&1
GIT_INDEX_FILE=$index git apply --cached "$1" &>/dev/null
patch_failed=$?
# Do it again, but show the error, if the problem is the patch itself.

View file

@ -119,7 +119,7 @@ if test $# -gt 0; then
fi
declare -a sign_args
if [ "$sign" == true ]; then
if [ "$sign" = true ]; then
sign_args=("-s")
fi

101
bin/git-rename-file Executable file
View file

@ -0,0 +1,101 @@
#!/usr/bin/env bash
set -euo pipefail
# Usage function
usage() {
cat <<EOF
Usage: git rename-file [OPTIONS] <source> <destination>
Description:
Rename a file or directory and ensure Git recognizes the change, regardless of filesystem case-sensitivity.
It combines the functionality of the "mv" command and "git mv". This is particularly useful for renaming files or directories
to change only their case, which might not be detected by Git on case-insensitive filesystems.
Options:
-h, --help Show this help message and exit.
Examples:
git rename-file old_filename new_filename
git rename-file old_directory new_directory
EOF
}
# Check for help option
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
usage
exit 0
fi
# Check for correct number of arguments
if [ "$#" -ne 2 ]; then
echo "Error: Incorrect number of arguments."
echo ""
usage >&2
exit 1
fi
# Assign variables
SOURCE="$1"
DESTINATION="$2"
TEMP_NAME="${SOURCE}.temp"
# Function to check if a file or directory exists in a case-sensitive manner
check_case_sensitive_exists() {
local path="$1"
local dir
local base
dir=$(dirname "$path")
base=$(basename "$path")
if [ -e "$dir" ]; then
if (cd "$dir" && find . -maxdepth 1 -name "$base" | grep -q "$base"); then
return 0
fi
fi
return 1
}
# Check if source exists and is under version control
if ! check_case_sensitive_exists "$SOURCE"; then
echo "Error: Source '$SOURCE' does not exist."
exit 1
fi
if ! git ls-files --error-unmatch "$SOURCE" > /dev/null 2>&1; then
echo "Error: Source '$SOURCE' is not under version control. If file or directory is new, it must at least be staged."
exit 1
fi
# Check if destination already exists
if check_case_sensitive_exists "$DESTINATION"; then
echo "Error: Destination '$DESTINATION' already exists."
exit 1
fi
# Check if the destination directory exists
DEST_DIR=$(dirname "$DESTINATION")
if ! check_case_sensitive_exists "$DEST_DIR"; then
echo "Error: Destination directory '$DEST_DIR' does not exist."
exit 1
fi
# Create a rollback function
rollback() {
echo "Rolling back changes..."
if [ -e "$TEMP_NAME" ]; then
git mv -f "$TEMP_NAME" "$SOURCE"
fi
}
# Trap errors to trigger rollback
trap 'rollback' ERR
# Move the file to a temporary name within the Git repository
git mv "$SOURCE" "$TEMP_NAME"
# Move the temporary file to the desired destination
git mv "$TEMP_NAME" "$DESTINATION"
echo "Successfully renamed '$SOURCE' to '$DESTINATION'."

View file

@ -1,8 +1,25 @@
#!/usr/bin/env bash
shopt -s extglob
git version
echo "git-extras version ""$(git-extras -v)"
echo "type 'ls' to ls files below current directory, '!command' to execute any command or just 'subcommand' to execute any git subcommand"
echo "Type 'ls' to ls files below current directory; '!command' to execute any command or just 'subcommand' to execute any git subcommand; 'quit', 'exit', 'q', ^D, or ^C to exit the git repl."
HISTIGNORE=${HISTIGNORE:-+([[:space:]])}
HISTCONTROL=${HISTCONTROL:-ignoredups}
use_local_history=$(git config --get --default 'false' git-extras.repl.use-local-history)
if [[ "$use_local_history" == "true" ]]; then
HISTFILE="$(git rev-parse --show-toplevel)/.git_extras_repl_history"
else
HISTFILE=${XDG_STATE_HOME:-$HOME/.local/state}/git_extras_repl_history
fi
# file doesn't exist, is empty, or contains only whitespace
if [[ ! -f "$HISTFILE" ]] || [[ ! -s "$HISTFILE" ]] || ! grep -q '[^[:space:]]' "$HISTFILE"; then
# `history -r` .... `history -a` are not happy with an empty initial file in bash 3.2.57, which is what MacOS 26 ships with
echo '!echo welcome to git-repl!' >> "$HISTFILE"
fi
history -r
while true; do
# Current branch
@ -10,34 +27,73 @@ while true; do
# Prompt
if test -n "$cur"; then
prompt="git ($cur)> "
cur_string=" ($cur)"
else
prompt="git> "
cur_string=""
fi
if test -n "$exit_status" && test "$exit_status" -ne 0; then
es_string=$' \e[31m['"$exit_status"$']\e[0m'
else
es_string=""
fi
prompt_character=$(git config --get --default '>' git-extras.repl.prompt-character)
prefix=$(git config --get --default 'git' git-extras.repl.prefix)
show_project_name=$(git config --get --default 'false' git-extras.repl.show-project-name)
if [[ "$show_project_name" == "true" ]]; then
project_name=" $(basename "$(git rev-parse --show-toplevel)" .git)"
else
project_name=""
fi
# Readline
read -e -r -p "$prompt" cmd
prompt_base="$prefix$project_name$cur_string$es_string$prompt_character"
prompt_base_stripped=$(echo "$prompt_base" | awk '{$1=$1};1')
prompt="$prompt_base_stripped "
# EOF
test $? -ne 0 && break
# Use arguments as a command if any are provided.
if [ $# -ne 0 ]; then
cmd=$*
set --
echo "$prompt" "$cmd" # It is as though you had entered a command.
else
# Readline
read -e -r -p "$prompt" cmd
# Check for EOF, and end the program if so (handles ^D).
test $? -ne 0 && break
fi
# History
history -s "$cmd"
# Add command to history if it is not all whitespace
if [[ ! "$cmd" =~ ^[[:space:]]*$ ]]; then
history -s "$cmd"
fi
# Built-in commands
case $cmd in
ls) cmd=ls-files;;
"") continue;;
quit|exit) break;;
"")
on_enter_cmd=$(git config --get --default '' git-extras.repl.on-enter-command)
if test -n "$on_enter_cmd"; then
cmd="$on_enter_cmd"
else
continue
fi
;;
quit|exit|q) break;;
esac
history -a
if [[ $cmd == !* ]]; then
eval ${cmd:1}
# shellcheck disable=SC2086
eval ${cmd:1}
elif [[ $cmd == git* ]]; then
# shellcheck disable=SC2086
eval $cmd
else
eval git "$cmd"
fi
exit_status=$?
done
echo

View file

@ -59,7 +59,7 @@ function php_lint()
function _dos2unix()
{
command -v dos2unix > /dev/null && dos2unix $@
command -v dos2unix > /dev/null && dos2unix "$@"
return 0
}
@ -68,8 +68,8 @@ function _sanitize()
git config --get-all extras.scp.sanitize | while read -r i
do
case $i in
php_lint) php_lint $@;; # git config --global --add extras.scp.sanitize php_lint
dos2unix) _dos2unix $@;; # git config --global --add extras.scp.sanitize dos2unix
php_lint) php_lint "$@";; # git config --global --add extras.scp.sanitize php_lint
dos2unix) _dos2unix "$@";; # git config --global --add extras.scp.sanitize dos2unix
esac
done
return $?
@ -77,10 +77,22 @@ function _sanitize()
function scp_and_stage
{
local verbose=0 interactive=0 dry_run=0
while :
do
case "$1" in
-v|--verbose) verbose=1; shift;;
-i|--interactive) verbose=1; interactive=1; shift;;
-n|--dry-run) verbose=1; dry_run=1; shift;;
*) break;;
esac
done
set_remote "$1"
shift
local refhead="$(git rev-parse --quiet --verify "$1")"
local refhead
refhead="$(git rev-parse --quiet --verify "$1")"
if [ -n "$refhead" ]
then
shift
@ -93,45 +105,116 @@ function scp_and_stage
list=$(git ls-files "$@")" "$(git ls-files -o "$@")
elif [ -n "$refhead" ]
then
git diff --stat "$refhead"
[ "$verbose" -eq 1 ] && git --no-pager diff --stat "$refhead"
list=$(git diff "$refhead" --name-only)
else
git diff
[ "$verbose" -eq 1 ] && git --no-pager diff
list=$(git diff --name-only)
fi
deleted=$(for i in $list; do [ -f "$i" ] || echo "$i"; done)
list=$(for i in $list; do [ -f "$i" ] && echo "$i"; done)
if [ "$interactive" -eq 1 ] && [ "$dry_run" -eq 0 ] && { [ -n "$list" ] || [ -n "$deleted" ]; }
then
local reply
read -r -p "Proceed with sync to $remote? [y/N] " reply
case "$reply" in
y|Y|yes|YES) ;;
*) _info "Aborted, nothing synced."; exit 0;;
esac
fi
local status=0
if [ -n "$list" ]
then
local _TMP=${0///}
echo "$list" > "$_TMP" &&
_sanitize $list &&
_info "Pushing to $remote ($(git config "remote.$remote.url"))" &&
rsync -rlDv --files-from="$_TMP" ./ "$(git config "remote.$remote.url")/" &&
git add --force $list &&
# shellcheck disable=SC2086
echo "$list" > "$_TMP"
if [ "$dry_run" -eq 1 ] || _sanitize $list
then
_info "Pushing to $remote ($(git config "remote.$remote.url"))"
if [ "$dry_run" -eq 1 ]
then
rsync -rlDvn --files-from="$_TMP" ./ "$(git config "remote.$remote.url")/"
else
rsync -rlDv --files-from="$_TMP" ./ "$(git config "remote.$remote.url")/" &&
git add --force $list
fi
status=$?
else
status=1
fi
rm "$_TMP"
fi
deleted=$(for i in $deleted; do echo "$(git config "remote.$remote.url" | cut -d: -f2)/$i"; done)
[ -n "$deleted" ] &&
COLOR_RED &&
echo Deleted remote files &&
ssh "$(git config "remote.$remote.url" | cut -d: -f1)" -t "rm $deleted" &&
echo "$deleted"
COLOR_RESET
if [ -n "$deleted" ]
then
COLOR_RED
echo Deleted remote files
if [ "$dry_run" -eq 1 ]
then
echo "$deleted"
else
if ssh "$(git config "remote.$remote.url" | cut -d: -f1)" -t "rm $deleted"
then
echo "$deleted"
else
status=1
fi
fi
COLOR_RESET
fi
return "$status"
}
function reverse_scp()
{
local verbose=0 interactive=0 dry_run=0
while :
do
case "$1" in
-v|--verbose) verbose=1; shift;;
-i|--interactive) verbose=1; interactive=1; shift;;
-n|--dry-run) verbose=1; dry_run=1; shift;;
*) break;;
esac
done
set_remote "$1"
shift
local _TMP=${0///}
echo $@ > "$_TMP" &&
rsync -rlDv --files-from="$_TMP" "$(git config "remote.$remote.url")/" ./ &&
echo "$@" > "$_TMP"
local status=0
if [ "$verbose" -eq 1 ]
then
rsync -rlDvn --files-from="$_TMP" "$(git config "remote.$remote.url")/" ./
status=$?
fi
if [ "$dry_run" -eq 1 ]
then
rm "$_TMP"
return "$status"
fi
if [ "$interactive" -eq 1 ]
then
local reply
read -r -p "Proceed with copy from $remote? [y/N] " reply
case "$reply" in
y|Y|yes|YES) ;;
*) _info "Aborted, nothing copied."; rm "$_TMP"; exit 0;;
esac
fi
rsync -rlDv --files-from="$_TMP" "$(git config "remote.$remote.url")/" ./ &&
rm "$_TMP"
}
@ -146,9 +229,14 @@ function _usage()
{
echo "Usage:
git scp -h|help|?
git scp <remote> [ref|file..] # scp and stage your files to specified remote
git scp <remote> [<ref>] # show diff relative to <ref> and upload unstaged files to <remote>
git rscp <remote> [<file|directory>] # copy <remote> files to current working directory
git scp [options] <remote> [ref|file..] # scp and stage your files to specified remote
git scp [options] <remote> [<ref>] # show diff relative to <ref> and upload unstaged files to <remote>
git rscp [options] <remote> [<file|directory>] # copy <remote> files to current working directory
OPTIONS:
-v, --verbose print what will be synced before syncing
-i, --interactive prompt for confirmation before syncing (implies --verbose)
-n, --dry-run show what would be synced, change nothing (implies --verbose; no staging, no remote writes/deletes)
"
case $1 in
@ -172,8 +260,8 @@ case $(basename "$0") in
git-scp)
case $1 in
''|-h|'?'|help|--help) shift; _test_git_scp; _usage "$@";;
*) scp_and_stage $@;;
*) scp_and_stage "$@";;
esac
;;
git-rscp) reverse_scp $@;;
git-rscp) reverse_scp "$@";;
esac

View file

@ -2,7 +2,7 @@
COMMIT_MESSAGE='Initial commit'
if [ "$1" == "-m" ]; then
if [ "$1" = "-m" ]; then
COMMIT_MESSAGE=$2
shift; shift
fi

View file

@ -35,7 +35,7 @@ in_git_repo=$?
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if command -v tput >/dev/null 2>&1; then
if command -v tput &>/dev/null; then
ncolors=$(tput colors)
fi
if [[ -t 1 ]] && [[ -n "$ncolors" ]] && [[ "$ncolors" -ge 8 ]] ; then
@ -227,7 +227,7 @@ git_output() {
echo ""
fi
fi
# TODO optimize:return if the latest commit of a branch is eariler than the 'since' day
# TODO optimize:return if the latest commit of a branch is earlier than the 'since' day
done
else
# shellcheck disable=SC2086
@ -240,7 +240,8 @@ if [[ $in_git_repo != 0 ]]; then
## Set delimiter to newline for the loop
IFS=$'\n'
## Recursively search for git repositories
PROJECT_DIRS=$(find "$INCLUDE_LINKS" . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)
# shellcheck disable=SC2086
PROJECT_DIRS=$(find $INCLUDE_LINKS . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)
# Fetch the latest commits, if required
if [ "$FETCH_LAST_COMMIT" = true ]; then

View file

@ -3,12 +3,16 @@
cd "$(git root)" || { echo "Can't cd to top level directory";exit 1; }
PROJECT_FULL_PATH=
SUMMARY_BY_LINE=
DEDUP_BY_EMAIL=
MERGES_ARG=
OUTPUT_STYLE=
for arg in "$@"; do
case "$arg" in
--full-path)
PROJECT_FULL_PATH=1
;;
--line)
SUMMARY_BY_LINE=1
;;
@ -45,30 +49,33 @@ if [ -n "$MERGES_ARG" ] && [ -n "$SUMMARY_BY_LINE" ]; then
exit 1
fi
commit="HEAD"
if [ -n "$SUMMARY_BY_LINE" ]; then
paths=( "$@" )
else
commit="HEAD"
[ $# -ne 0 ] && commit=$*
fi
project=${PWD##*/}
if [[ -n "$PROJECT_FULL_PATH" ]]; then
project=${PWD/${HOME}/\~}
else
project=${PWD##*/}
fi
#
# get date for the given <commit>
#
date() {
commit_date() {
# the $1 can be empty
# shellcheck disable=SC2086
git log $MERGES_ARG --pretty='format: %ai' $1 | cut -d ' ' -f 2
git log $MERGES_ARG --pretty='format: %ai' "$1" | cut -d ' ' -f 2
}
#
# get active days for the given <commit>
#
active_days() {
# shellcheck disable=SC2086
date $1 | sort -r | uniq | awk '
commit_date "$1" | sort -r | uniq | awk '
{ sum += 1 }
END { print sum }
'
@ -79,7 +86,7 @@ active_days() {
#
commit_count() {
# shellcheck disable=SC2086
git log $MERGES_ARG --oneline $commit | wc -l | tr -d ' '
git rev-list $MERGES_ARG --count "$commit"
}
#
@ -195,14 +202,14 @@ uncommitted_changes_count() {
}
COLUMN_CMD_DELIMTER="¬" # Hopefully, this symbol is not used in branch names... I use it as a seperator for columns
COLUMN_CMD_DELIMTER="¬" # Hopefully, this symbol is not used in branch names... I use it as a separator for columns
SP="$COLUMN_CMD_DELIMTER|"
print_summary_by_line() {
if [ "$OUTPUT_STYLE" == "tabular" ]; then
if [ "$OUTPUT_STYLE" = "tabular" ]; then
tabular_headers="# Repo $SP Lines"
echo -e "$tabular_headers\n$project $SP $(line_count "${paths[@]}")" | column -t -s "$COLUMN_CMD_DELIMTER"
elif [ "$OUTPUT_STYLE" == "oneline" ]; then
elif [ "$OUTPUT_STYLE" = "oneline" ]; then
echo "$project / lines: $(line_count "${paths[@]}")"
elif [ -n "$SUMMARY_BY_LINE" ]; then
echo
@ -214,24 +221,22 @@ print_summary_by_line() {
}
print_summary() {
if [ "$OUTPUT_STYLE" == "tabular" ]; then
if [ "$OUTPUT_STYLE" = "tabular" ]; then
tabular_headers="# Repo $SP Age $SP Last active $SP Active on $SP Commits $SP Uncommitted $SP Branch"
echo -e "$tabular_headers\n$project $SP $(repository_age) $SP $(last_active) $SP $(active_days $commit) days $SP $(commit_count $commit) $SP $(uncommitted_changes_count) $SP $(current_branch_name)" | column -t -s "$COLUMN_CMD_DELIMTER"
elif [ "$OUTPUT_STYLE" == "oneline" ]; then
echo "$project / age: $(repository_age) / last active: $(last_active) / active on $(active_days $commit) days / commits: $(commit_count $commit) / uncommitted: $(uncommitted_changes_count) / branch: $(current_branch_name)"
echo -e "$tabular_headers\n$project $SP $(repository_age) $SP $(last_active) $SP $(active_days "$commit") days $SP $(commit_count "$commit") $SP $(uncommitted_changes_count) $SP $(current_branch_name)" | column -t -s "$COLUMN_CMD_DELIMTER"
elif [ "$OUTPUT_STYLE" = "oneline" ]; then
echo "$project / age: $(repository_age) / last active: $(last_active) / active on $(active_days "$commit") days / commits: $(commit_count "$commit") / uncommitted: $(uncommitted_changes_count) / branch: $(current_branch_name)"
else
echo
echo " project : $project"
echo " repo age : $(repository_age)"
echo " branch: : $(current_branch_name)"
echo " last active : $(last_active)"
# shellcheck disable=SC2086
echo " active on : $(active_days $commit) days"
# shellcheck disable=SC2086
echo " commits : $(commit_count $commit)"
echo " active on : $(active_days "$commit") days"
echo " commits : $(commit_count "$commit")"
# The file count doesn't support passing a git ref so ignore it if a ref is given
if [ "$commit" == "HEAD" ]; then
if [ "$commit" = "HEAD" ]; then
echo " files : $(file_count)"
fi
echo " uncommitted : $(uncommitted_changes_count)"
@ -239,10 +244,10 @@ print_summary() {
if [ -n "$DEDUP_BY_EMAIL" ]; then
# the $commit can be empty
# shellcheck disable=SC2086
git shortlog $MERGES_ARG -n -s -e $commit | dedup_by_email | format_authors
git shortlog $MERGES_ARG -n -s -e "$commit" | dedup_by_email | format_authors
else
# shellcheck disable=SC2086
git shortlog $MERGES_ARG -n -s $commit | format_authors
git shortlog $MERGES_ARG -n -s "$commit" | format_authors
fi
fi
}

14
bin/git-unwip Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Based on scripts from git-utils:
# * https://github.com/ddollar/git-utils/blob/master/git-unwip
# Check if the last commit is a 'WIP' commit
LAST_COMMIT=`git log -1 --pretty=%B | tr -d '[:space:]'`
if [ 'WIP' != $LAST_COMMIT ]; then
echo 'Last commit is not a WIP commit, so it will not be unWIP-ed.'
exit 1
fi
git undo --soft

View file

@ -2,42 +2,130 @@
#
# Change files modification time to their last commit date
#
if [ "$1" = "--touch" ]; then
# Internal use option only just to parallelize things.
newer_flag=""
[ "$2" = "--newer" ] && newer_flag="true"
shift 2
bsd=$(date -j > /dev/null 2>&1 && echo 'true')
if [ -n "$bsd" ]; then
stat_flags="-f %m"
date_flags="-r"
else
stat_flags="-c %Y"
date_flags="-d@"
fi
for f; do
git_s=$(git --no-pager log --no-renames --pretty=format:%ct -1 @ -- "$f" 2>/dev/null)
mod_s=$(stat $stat_flags "$f" 2>/dev/null)
if [ -n "$git_s" ] && [ -n "$mod_s" ] && [ "$mod_s" -ne "$git_s" ]; then
if [ "$mod_s" -gt "$git_s" ] || [ -z "$newer_flag" ]; then
t=$(date $date_flags$git_s '+%Y%m%d%H%M.%S')
echo "+ touch -h -t $t $f" >&2
touch -h -t "$t" "$f"
fi
fi
done
else
opt_r=$(xargs -r false < /dev/null > /dev/null 2>&1 && echo '-r')
# `-n` should be limited or parallelization will not give effect,
# because all args will go into single worker.
NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
# don't touch files that have been modified in the worktree or index
# bsd doesn't have `-z` option for `comm` and `cut`, so use `tr` as work around
prefix="$(git rev-parse --show-prefix) "
comm -23 <(git ls-tree -z -r --name-only --full-name @ | tr '\0' '\n' | sort) \
<(git status -z --porcelain | tr '\0' '\n' | cut -c 4- | sort) \
| cut -c ${#prefix}- \
| tr '\n' '\0' \
| xargs -0 -P"${NPROC:-1}" -n 24 $opt_r git utimes --touch "$1"
# Bash unofficial strict mode
set -euo pipefail
IFS=$'\n\t'
if [[ "${1:-}" == "--newer" ]]; then
op=le
shift
else
op=eq
fi
# BSD systems
if date -j &>/dev/null; then
stat_flags="-f %m"
date_flags="-r"
else
# Non-BSD systems
stat_flags="-c %Y"
date_flags="-d@"
fi
bash_opts=()
if bash --help 2>&1 | grep -q -- '--noprofile'; then
bash_opts+=(--noprofile)
fi
if bash --help 2>&1 | grep -q -- '--norc'; then
bash_opts+=(--norc)
fi
status_opts=(--porcelain --short)
# %ct: committer date, UNIX timestamp / %at: author date, UNIX timestamp
log_opts=(--format='%ct')
if git status --help 2>&1 | grep -q -- "--no-renames"; then
status_opts+=(--no-renames)
log_opts+=(--no-renames)
fi
if git status --help 2>&1 | grep -q -- "--untracked-files"; then
status_opts+=(--untracked-files=no)
fi
if git status --help 2>&1 | grep -q -- "--ignored"; then
status_opts+=(--ignored=no)
fi
prefix="$(git rev-parse --show-prefix) "
strip="${#prefix}"
tmpfile=$(mktemp)
# shellcheck disable=SC2064
trap "rm -f '${tmpfile}'" 0
awk_flags=(
-F'\t'
-v date_flags="${date_flags}"
-v op="${op}"
-v stat_flags="${stat_flags}"
-v strip="${strip}"
-v tmpfile="${tmpfile}"
)
# sanity check, not required:
if awk --help 2>&1 | grep -q -- '--posix'; then
awk_flags+=(--posix)
fi
read -r -d '' awk_script <<"EOF" || true
BEGIN {
seen[""]=1
print "#!/usr/bin/env bash"
print "set +e"
print "t() {"
print " test -e \"$2\" || return 0"
printf(" test \"$(stat %s \"$2\" 2>/dev/null)\" -%s \"$1\" && return 0\n", stat_flags, op)
if (date_flags == "-d@") {
print " echo \"+ touch -h -d@$1 $2\""
print " touch -h -d@$1 \"$2\""
} else {
print " t=$(date -r$1 \"+%Y%m%d%H%M.%S\")"
print " echo \"+ touch -h -t $t $2\""
print " touch -h -t $t \"$2\""
}
print "}"
}
FILENAME==tmpfile {
skip[$1]=1
next
}
# skip blank lines
!/^$/ {
# skip deletes
if (substr($1, length($1), 1) ~ /D/) {
next
}
if (NF == 1) {
ct=$1
next
}
$2 = substr($2, strip, length($2)- strip + 1)
if ($2 in seen) {
next
}
if ($2 in skip) {
next
}
seen[$2]=1
# remove enclosing double quotes that git adds:
if (substr($2, 1, 1) == "\"" && substr($2, length($2), 1) == "\"") {
$2 = substr($2, 2, length($2) - 2)
# unescape remaining double quotes
gsub(/\\"/, "\"", $2)
# unescape escaped backslashes
gsub(/\\\\/, "\\", $2)
}
# escape apostrophes: ' => '\''
gsub(/'/, "'\\''", $2)
printf("t %s '%s'\n", ct, $2)
}
EOF
# prefix is stripped:
git --no-pager status "${status_opts[@]}" . \
| cut -c 4- >"${tmpfile}"
# prefix is not stripped:
git --no-pager log --raw --no-merges "${log_opts[@]}" . \
| awk "${awk_flags[@]}" "${awk_script}" "${tmpfile}" - \
| BASH_ENV='' bash "${bash_opts[@]}" -

8
bin/git-wip Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# Based on scripts from git-utils:
# * https://github.com/ddollar/git-utils/blob/master/git-wip
# * https://github.com/ddollar/git-utils/blob/master/git-addremove
git add --all
git commit --all --message="WIP"

View file

@ -3,7 +3,7 @@ index e49cd24..4ae28b5 100755
--- a/bin/git-extras
+++ b/bin/git-extras
@@ -4,13 +4,12 @@ VERSION="4.3.0"
INSTALL_SCRIPT="https://raw.githubusercontent.com/tj/git-extras/master/install.sh"
INSTALL_SCRIPT="https://raw.githubusercontent.com/tj/git-extras/main/install.sh"
update() {
- local bin="$(command -v git-extras)"

View file

@ -6,7 +6,7 @@ err() {
}
make_doc() {
echo "'touch man/git-$1.md && make man/git-$1.{1,html}'"
echo "touch man/git-$1.md && make man/git-$1.{1,html}"
}
check_bash_script() {
@ -25,7 +25,7 @@ check_bash_script() {
check_git_extras_cmd_list() {
local whitelist=('extras')
for cmd in ${whitelist[*]}; do
for cmd in "${whitelist[@]}"; do
test "$1" == "$cmd" && return
done
@ -47,6 +47,11 @@ check_documentation() {
err "Create man/$cmd.1 and man/$cmd.html via $(make_doc "$1")"
fi
if [ "man/$cmd.md" -nt "man/$cmd.1" ] || [ "man/$cmd.md" -nt "man/$cmd.html" ]
then
err "man/$cmd.md, man/$cmd.1, and man/$cmd.html all exist, but man/$cmd.md is newer. You should rm man/$cmd.{1,html} && $(make_doc "$1")"
fi
check_git_extras_cmd_list "$@"
check_man_page_index "$@"
}
@ -54,7 +59,7 @@ check_documentation() {
check_Commands_page() {
# These are special cases. All listed together, so we ignore them
local whitelist=('bug' 'chore' 'feature' 'refactor')
for cmd in ${whitelist[*]}; do
for cmd in "${whitelist[@]}"; do
test "$1" == "$cmd" && return
done
@ -77,12 +82,9 @@ check() {
check_completion "$1"
}
usage() {
echo >&2 "Usage: ./check_integrity.sh <command-name> [<command-name2> ...]"
exit 0
}
test $# == 0 && set -- $(find bin | cut -b 5- | xargs)
test $# == 0 && usage
./bin/git-utimes --newer
for name in "$@"; do
name=${name#git-}

View file

@ -1,5 +1,29 @@
# shellcheck shell=bash
# bash completion support for git-extras.
__gitex_heads_unique() {
local branch specified=("${COMP_WORDS[@]:2}")
for branch in $(__git_heads); do
[[ " ${specified[*]} " == *" $branch "* ]] || printf '%s\n' "$branch"
done
}
_git_authors(){
__gitcomp "-l --list --no-email"
}
_git_browse(){
__git_complete_remote_or_refspec
}
_git_browse_ci(){
__git_complete_remote_or_refspec
}
_git_brv(){
__gitcomp "-r --reverse"
}
_git_changelog(){
local s_opts=( '-a' '-l' '-t' '-f' '-s' '-n' '-p' '-x' '-h' '?' )
local l_opts=(
@ -21,8 +45,29 @@ _git_changelog(){
__gitcomp "$merged_opts_str"
}
_git_authors(){
__gitcomp "-l --list --no-email"
_git_coauthor(){
local oldIfs=$IFS
IFS=$'\n'
local cur="${COMP_WORDS[COMP_CWORD]}"
local selection=
if ((COMP_CWORD == 2)); then
for line in $(git authors --list); do
selection+="${line% *}"$'\n'
done
elif ((COMP_CWORD == 3)); then
local chosen_name="${COMP_WORDS[COMP_CWORD-1]}"
for line in $(git authors --list); do
if [ "$chosen_name" = "${line% *}" ]; then
local email=${line#*<}
email=${email%>*}
selection+="$email"$'\n'
fi
done
fi
compopt +o default
compopt -o filenames
COMPREPLY=($(compgen -W "$selection" -- "$cur"))
IFS=$oldIfs
}
_git_contrib(){
@ -37,6 +82,10 @@ _git_contrib(){
COMPREPLY=($(compgen -W "$all" -- "$cur"))
}
_git_commits_since(){
__gitcomp "-r --ref"
}
_git_count(){
__gitcomp "--all"
}
@ -46,7 +95,7 @@ __git_cp(){
}
_git_delete_branch(){
__gitcomp "$(__git_heads)"
__gitcomp "$(__gitex_heads_unique)"
}
_git_delete_squashed_branches(){
@ -66,6 +115,7 @@ _git_effort(){
case "$cur" in
--*)
# shellcheck disable=SC2154
__gitcomp "
--above
$__git_log_common_options
@ -81,7 +131,7 @@ _git_extras(){
}
__git_extras_workflow(){
__gitcomp "$(__git_heads | grep -- ^$1/ | sed s/^$1\\///g) finish"
__gitcomp "$(__git_heads | grep -- "^$1/" | sed s/^"$1"\\///g) finish"
}
_git_feature(){
@ -95,16 +145,20 @@ _git_graft(){
_git_ignore(){
case "$cur" in
--*)
__gitcomp "--global --local --private"
__gitcomp "--global --local --private --edit --remove"
return
;;
-*)
__gitcomp "--global --local --private -g -l -p"
__gitcomp "--global --local --private --edit --remove -g -l -p -e -r"
return
;;
esac
}
_git_info(){
__gitcomp "--color -c --no-config"
}
_git_missing(){
# Suggest all known refs
__gitcomp "$(git for-each-ref --format='%(refname:short)')"
@ -127,34 +181,40 @@ _git_reauthor(){
__gitcomp "${comp}"
}
_git_scp(){
__git_complete_remote_or_refspec
__git_extras_rename(){
if ((COMP_CWORD == 2 || COMP_CWORD == 3)); then
__gitcomp "$1"
fi
}
_git_stamp(){
__gitcomp '--replace -r'
_git_rename_branch(){
__git_extras_rename "$(__git_heads)"
}
_git_rename_remote(){
__git_extras_rename "$(__git_remotes)"
}
_git_rename_tag(){
__git_extras_rename "$(__git_tags)"
}
_git_rscp(){
__git_complete_remote_or_refspec
}
_git_scp(){
__git_complete_remote_or_refspec
}
_git_squash(){
__gitcomp "$(__git_heads)"
}
_git_stamp(){
__gitcomp '--replace -r'
}
_git_undo(){
__gitcomp "--hard --soft -h -s"
}
_git_info(){
__gitcomp "--color -c --no-config"
}
_git_browse(){
__git_complete_remote_or_refspec
}
_git_browse_ci(){
__git_complete_remote_or_refspec
}

View file

@ -51,7 +51,7 @@ __gitex_remote_names() {
local expl
declare -a remote_names
remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
__git_command_successful || return
__gitex_command_successful || return
_wanted remote-names expl remote-name compadd $* - $remote_names
}
@ -59,7 +59,7 @@ __gitex_tag_names() {
local expl
declare -a tag_names
tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
__git_command_successful || return
__gitex_command_successful || return
_wanted tag-names expl tag-name compadd $* - $tag_names
}
@ -68,15 +68,24 @@ __gitex_branch_names() {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
__git_command_successful || return
__gitex_command_successful || return
_wanted branch-names expl branch-name compadd $* - $branch_names
}
__gitex_branch_names_unique() {
local expl
declare -a branch_names already_specified
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
__gitex_command_successful || return
already_specified=(${words[2,-1]})
_wanted branch-names expl branch-name compadd -F already_specified $* - $branch_names
}
__gitex_specific_branch_names() {
local expl
declare -a branch_names
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
__git_command_successful || return
__gitex_command_successful || return
_wanted branch-names expl branch-name compadd - $branch_names
}
@ -88,16 +97,31 @@ __gitex_submodule_names() {
local expl
declare -a submodule_names
submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"}) # '
__git_command_successful || return
__gitex_command_successful || return
_wanted submodule-names expl submodule-name compadd $* - $submodule_names
}
__gitex_workspace_names() {
local expl
declare -a workspace_names
workspace_names=($(git bulk --listall | awk '{print $1}' | cut -d "." -f 2))
__gitex_command_successful || return
_wanted workspace-names expl workspace-names compadd $* - $workspace_names
}
__gitex_author_names() {
local expl
declare -a author_names
author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
__git_command_successful || return
__gitex_command_successful || return
_wanted author-names expl author-name compadd $* - $author_names
}
__gitex_author_emails() {
local expl
declare -a author_names
author_names=(${(f)"$(_call_program branchrefs git log --format='%aE' | sort -u)"})
__gitex_command_successful || return
_wanted author-names expl author-name compadd $* - $author_names
}
@ -109,6 +133,27 @@ _git-authors() {
'--no-email[without email]' \
}
_git-brv() {
_arguments \
'(-r --reverse)'{-r,--reverse}'[reverse order]'
}
_git-bulk() {
_arguments \
'-a[Run a git command on all workspaces and their repositories.]' \
'-g[Ask the user for confirmation on every execution (guarded mode).]' \
'-w[Run the git command on the specified workspace.]:workspace-name:__gitex_workspace_names' \
'-q[Suppress bulk output about current execution (quiet mode).]' \
'--no-follow-symlinks[Do not traverse symbolic links when searching for git repositories.]' \
'--no-follow-hidden[Do not traverse hidden directories when searching for git repositories.]' \
'--addworkspace[Register a workspace for bulk operations.]' \
'--removeworkspace[Remove the specified workspace.]:workspace-name:__gitex_workspace_names' \
'--addcurrent[Adds the current directory as workspace to git bulk operations]' \
'--purge[Removes all defined repository locations.]' \
'--listall[List all registered repositories.]' \
'--help[Show the help.]'
}
_git-changelog() {
_arguments \
'(-l --list)'{-l,--list}'[list commits]' \
@ -122,8 +167,13 @@ _git-clear() {
_git-coauthor() {
_arguments \
':co-author[co-author to add]' \
':co-author-email[email address of co-author to add]'
':co-author[co-author to add]:__gitex_author_names' \
':co-author-email[email address of co-author to add]:__gitex_author_emails'
}
_git-commits-since() {
_arguments \
'(-r --ref)'{-r,--ref}'[show commits since ref]'
}
_git-contrib() {
@ -160,8 +210,12 @@ _git-create-branch() {
}
_git-delete-branch() {
__gitex_branch_names_unique
}
_git-delete-gone-branches() {
_arguments \
':branch-name:__gitex_branch_names'
'(-n --dry-run)'{-n,--dry-run}'[show branches that would be deleted without deleting]'
}
_git-delete-squashed-branches() {
@ -263,9 +317,12 @@ _git-guilt() {
_git-ignore() {
_arguments -C \
'(--local -l)'{--local,-l}'[show local gitignore]' \
'(--global -g)'{--global,-g}'[show global gitignore]' \
'(--private -p)'{--private,-p}'[show repo gitignore]'
'(--local -l)'{--local,-l}'[set context to local gitignore]' \
'(--global -g)'{--global,-g}'[set context to global gitignore]' \
'(--private -p)'{--private,-p}'[set context to private gitignore]' \
'(--edit -e)'{--edit,-e}'[set action to edit]' \
'(--remove -r)'{--remove,-r}'[set action to remove]' \
'*:filename:_files'
}
@ -302,6 +359,14 @@ _git-release() {
'--[The arguments listed after "--" separator will be passed to pre/post-release hook.]'
}
_git-rename-file() {
_arguments -C \
'-h[show usage information]' \
'--help[show usage information]' \
'1:source:__git_files' \
'2:destination:__git_files'
}
_git-squash() {
_arguments '--squash-msg[commit with the squashed commit messages]'
_arguments \
@ -327,6 +392,7 @@ _git-standup() {
}
_git-summary() {
_arguments '--full-path[show repository full path]'
_arguments '--line[summarize with lines rather than commits]'
_arguments '--dedup-by-email[remove duplicate users by the email address]'
_arguments '--no-merges[exclude merge commits]'
@ -357,10 +423,12 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
clear:'rigorously clean up a repository' \
coauthor:'add a co-author to the last commit' \
commits-since:'show commit logs since some date' \
continue:'continue current revert, merge, rebase, or cherry-pick process' \
contrib:'show user contributions' \
count:'show commit count' \
create-branch:'create branches' \
delete-branch:'delete branches' \
delete-gone-branches:'delete branches whose remote is gone' \
delete-merged-branches:'delete merged branches' \
delete-squashed-branches:'delete squashed branches' \
delete-submodule:'delete submodules' \
@ -370,13 +438,14 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
extras:'awesome git utilities' \
feature:'create/merge feature branch' \
force-clone:'overwrite local repositories with clone' \
fork:'fork a repo on github' \
fork:'fork a repo on GitHub' \
fresh-branch:'create fresh branches' \
gh-pages:'create the github pages branch' \
get:'clone a repository in a directory' \
gh-pages:'create the GitHub pages branch' \
graft:'merge and destroy a given branch' \
guilt:'calculate change between two revisions' \
ignore-io:'get sample gitignore file' \
ignore:'add .gitignore patterns' \
ignore:'Modify or display .gitignore files' \
info:'returns information on current repository' \
local-commits:'list local commits' \
lock:'lock a file excluded from version control' \
@ -396,6 +465,7 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
refactor:'create refactor branch' \
release:'commit, tag and push changes to the repository' \
rename-branch:'rename a branch' \
rename-file:'rename a file or directory and ensure Git recognizes the change, regardless of filesystem case-sensitivity' \
rename-tag:'rename a tag' \
rename-remote:'rename a remote' \
repl:'git read-eval-print-loop' \
@ -415,4 +485,6 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
touch:'touch and add file to the index' \
undo:'remove latest commits' \
unlock:'unlock a file excluded from version control' \
utimes:'change files modification time to their last commit date'
utimes:'change files modification time to their last commit date' \
unwip:'undo a WIP commit' \
wip:'create a WIP commit'

View file

@ -27,11 +27,12 @@ set __fish_git_extras_commands \
"force-clone:overwrite local repositories with clone" \
"fork:Fork a repo on github" \
"fresh-branch:Create fresh branches" \
"get:Clone a repository in a directory" \
"gh-pages:Create the GitHub Pages branch" \
"graft:Merge and destroy a given branch" \
"guilt:calculate change between two revisions" \
"ignore-io:Get sample gitignore file" \
"ignore:Add .gitignore patterns" \
"ignore:Modify or display .gitignore files" \
"info:Returns information on current repository" \
"local-commits:List local commits" \
"lock:Lock a file excluded from version control" \
@ -49,6 +50,7 @@ set __fish_git_extras_commands \
"rebase-patch:Rebases a patch" \
"release:Commit, tag and push changes to the repository" \
"rename-branch:rename local branch and push to remote" \
"rename-file:rename a file or directory and ensure Git recognizes the change, regardless of filesystem case-sensitivity" \
"rename-remote:Rename a remote" \
"rename-tag:Rename a tag" \
"repl:git read-eval-print-loop" \
@ -70,20 +72,22 @@ set __fish_git_extras_commands \
"unlock:Unlock a file excluded from version control"
# completion for git-extras itself
complete -c git -f -n '__fish_git_needs_command' -a 'extras' -d 'GIT utilities: repo summary, repl, changelog population, and more'
complete -c git -f -n __fish_git_needs_command -a extras -d 'GIT utilities: repo summary, repl, changelog population, and more'
complete -c git -f -n '__fish_git_using_command extras' -s h -l help -d 'Show the help message, can be used for any git-extras commands'
complete -c git -f -n '__fish_git_using_command extras' -s v -l version -d 'Show git-extras version number'
complete -c git -f -n '__fish_git_using_command extras; and not contains -- update (commandline -opc)' -a "update" -d 'Self update'
complete -c git -f -n '__fish_git_using_command extras; and not contains -- update (commandline -opc)' -a update -d 'Self update'
# completion for git-extras provided commands
set __fish_git_extras_commands (printf -- '%s\n' $__fish_git_extras_commands | sed 's/:/\textras:/' | string collect | string escape)
complete -c git -n '__fish_git_needs_command' -a "$__fish_git_extras_commands"
complete -c git -n __fish_git_needs_command -a "$__fish_git_extras_commands"
# authors
complete -c git -f -n '__fish_git_using_command authors' -s l -l list -d 'show authors'
complete -c git -f -n '__fish_git_using_command authors' -l no-email -d 'without email'
# brv
complete -c git -f -n '__fish_git_using_command brv' -s r -l reverse -d 'reverse the sort order'
# bulk
complete -c git -n '__fish_git_using_command bulk' -s a -d 'Run a git command on all workspaces and their repositories'
complete -c git -n '__fish_git_using_command bulk' -s g -d 'Ask the user for confirmation on every execution'
complete -c git -n '__fish_git_using_command bulk' -s a -d 'Run a git command on all workspaces and their repositories'
complete -c git -n '__fish_git_using_command bulk' -s g -d 'Ask the user for confirmation on every execution'
complete -c git -x -n '__fish_git_using_command bulk' -s w -d 'Run on specified workspace'
complete -c git -x -n '__fish_git_using_command bulk' -l addworkspace -d 'Register a workspace for builk operations'
complete -c git -x -n '__fish_git_using_command bulk; and contains addworkspace (commandline -opc)' -l addworkspace -d 'the URL or file with URLs to be added'
@ -102,6 +106,33 @@ complete -c git -f -n '__fish_git_using_command changelog' -s n -l no-merges -d
complete -c git -f -n '__fish_git_using_command changelog' -s m -l merges-only -d 'Uses only merge commits (commits with more than 1 parent) for generated changelog'
complete -c git -f -n '__fish_git_using_command changelog' -s p -l prune-old -d 'Replace existing changelog entirely with newly generated content'
complete -c git -f -n '__fish_git_using_command changelog' -s x -l stdout -d 'Write output to stdout instead of to a new changelog file'
# coauthor
function __fish_git_arg_number -a number
set -l cmd (commandline -opc)
test (count $cmd) -eq $number
end
function __fish_git_extra_coauthor_name
for line in (git authors --list)
printf '%s\n' $line | string replace --regex ' <.*' ''
end
end
function __fish_git_extra_coauthor_email
set -l cmd (commandline -opc)
# name provided in the previous positional argument
set -l name $cmd[3]
for line in (git authors --list)
set -l loop_name (printf '%s\n' $line | string replace --regex ' <.*' '')
if test "$name" = "$loop_name"
printf '%s\n' $line | string replace --regex '.*?<' '' | string replace --regex '>.*?' ''
end
end
end
complete -c git -f -n '__fish_git_using_command coauthor; and __fish_git_arg_number 2' -a '(__fish_git_extra_coauthor_name)'
complete -c git -f -n '__fish_git_using_command coauthor; and __fish_git_arg_number 3' -a '(__fish_git_extra_coauthor_email)'
# commits-since
complete -c git -f -n '__fish_git_using_command commits-since' -s r -l ref -d 'show commits since ref'
# count
complete -c git -f -n '__fish_git_using_command count' -l all -d 'detailed commit count'
# create-branch
@ -118,22 +149,24 @@ complete -c git -x -n "__fish_git_using_command delete-tag" -a '(__fish_git for-
complete -c git -f -n '__fish_git_using_command effort' -l above -d 'ignore file with less than x commits'
# feature
complete -c git -x -n '__fish_git_using_command feature' -s a -l alias -d 'use branch_prefix instead of feature'
complete -c git -f -n '__fish_git_using_command feature; and not contains -- finish (commandline -opc)' -a "finish" -d 'merge and delete the feature branch'
complete -c git -f -n '__fish_git_using_command feature; and not contains -- finish (commandline -opc)' -a finish -d 'merge and delete the feature branch'
complete -c git -f -n '__fish_git_using_command feature; and contains -- finish (commandline -opc)' -l squash -d 'Run a squash merge'
complete -c git -x -n '__fish_git_using_command feature; and contains -- finish (commandline -opc)' -a '(__fish_git for-each-ref --format="%(refname)" 2>/dev/null | grep "refs/heads/feature")' -d 'name of feature branch'
complete -c git -x -n '__fish_git_using_command feature; and not contains -- finish (commandline -opc)' -s r -l remote -a '(__fish_git_unique_remote_branches)' -d 'Setup a remote tracking branch'
# graft
complete -c git -x -n '__fish_git_using_command graft' -s r -l remote -a '(__fish_git_branches)' -d 'src-branch-name'
complete -c git -x -n '__fish_git_using_command graft' -s r -l remote -a '(__fish_git_branches)' -d 'dest-branch-name'
complete -c git -x -n '__fish_git_using_command graft' -s r -l remote -a '(__fish_git_branches)' -d src-branch-name
complete -c git -x -n '__fish_git_using_command graft' -s r -l remote -a '(__fish_git_branches)' -d dest-branch-name
# guilt
complete -c git -f -n '__fish_git_using_command guilt' -s w -l ignore-whitespace -d 'ignore whitespace only changes'
complete -c git -f -n '__fish_git_using_command guilt' -s e -l email -d 'display author emails instead of names'
complete -c git -f -n '__fish_git_using_command guilt' -s d -l debug -d 'output debug information'
complete -c git -f -n '__fish_git_using_command guilt' -s h -d 'output usage information'
complete -c git -f -n '__fish_git_using_command guilt' -s h -d 'output usage information'
# ignore
complete -c git -f -n '__fish_git_using_command ignore' -s l -l local -d 'show local gitignore'
complete -c git -f -n '__fish_git_using_command ignore' -s g -l global -d 'show global gitignore'
complete -c git -f -n '__fish_git_using_command ignore' -s p -l private -d 'show repo gitignore'
complete -c git -f -n '__fish_git_using_command ignore' -s l -l local -d 'set context to local gitignore'
complete -c git -f -n '__fish_git_using_command ignore' -s g -l global -d 'set context to global gitignore'
complete -c git -f -n '__fish_git_using_command ignore' -s p -l private -d 'set context to private gitignore'
complete -c git -f -n '__fish_git_using_command ignore' -s e -l edit -d 'set action to edit'
complete -c git -f -n '__fish_git_using_command ignore' -s r -l remove -d 'set action to remove'
# ignore-io
function __fish_git_extra_get_ignore_io_types
# we will first remove every tab spaces, and then append `\t` at the end to remove the default description
@ -148,33 +181,35 @@ complete -c git -x -n '__fish_git_using_command ignore-io' -s s -l search -d 'se
complete -c git -x -n '__fish_git_using_command ignore-io' -s t -l show-update-time -d 'Show the last modified time of ~/.gi_list'
complete -c git -x -n '__fish_git_using_command ignore-io' -s u -l update -d 'Update ~/.gi_list'
# merge-into
complete -c git -n '__fish_git_using_command merge-into' -l ff-only -d 'merge only fast-forward'
complete -c git -n '__fish_git_using_command merge-into' -l ff-only -d 'merge only fast-forward'
complete -c git -x -n '__fish_git_using_command merge-into' -a '(__fish_git_branches)'
# missing
complete -c git -x -n '__fish_git_using_command missing' -a '(__fish_git_branches)'
# rename-file
complete -c git -f -n '__fish_git_using_command rename-file' -s h -l help -d 'Show usage information'
# squash
complete -c git -x -n '__fish_git_using_command squash' -a '(__fish_git_branches)'
complete -c git -x -n '__fish_git_using_command squash' -l squash-msg -d 'commit with the squashed commit messages'
# stamp
complete -c git -x -n '__fish_git_using_command stamp' -s r -l replace -d 'replace stamps with same id'
# standup
complete -c git -x -n '__fish_git_using_command standup' -s a -d 'Specify the author of commits. Use "all" to specify all authors'
complete -c git -x -n '__fish_git_using_command standup' -s a -d 'Specify the author of commits. Use all to specify all authors'
complete -c git -x -n '__fish_git_using_command standup' -s m -d 'The depth of recursive directory search'
complete -c git -x -n '__fish_git_using_command standup' -s d -d 'Show history since N days ago'
complete -c git -x -n '__fish_git_using_command standup' -s D -d 'Specify the date format displayed in commit history'
complete -c git -n '__fish_git_using_command standup' -s f -d 'Fetch commits before showing history'
complete -c git -n '__fish_git_using_command standup' -s g -d 'Display GPG signed info'
complete -c git -n '__fish_git_using_command standup' -s h -l help -d 'Display help message'
complete -c git -n '__fish_git_using_command standup' -s L -d 'Enable the inclusion of symbolic links'
complete -c git -n '__fish_git_using_command standup' -s B -d 'Display the commits in branch group'
complete -c git -n '__fish_git_using_command standup' -s f -d 'Fetch commits before showing history'
complete -c git -n '__fish_git_using_command standup' -s g -d 'Display GPG signed info'
complete -c git -n '__fish_git_using_command standup' -s h -l help -d 'Display help message'
complete -c git -n '__fish_git_using_command standup' -s L -d 'Enable the inclusion of symbolic links'
complete -c git -n '__fish_git_using_command standup' -s B -d 'Display the commits in branch group'
complete -c git -x -n '__fish_git_using_command standup' -s n -d 'Limit the number of commits displayed per group'
# summary
complete -c git -n '__fish_git_using_command summary' -l line -d 'summarize with lines rather than commits'
complete -c git -n '__fish_git_using_command summary' -l dedup-by-email -d 'remove duplicate users by the email address'
complete -c git -n '__fish_git_using_command summary' -l no-merges -d 'exclude merge commits'
complete -c git -n '__fish_git_using_command summary' -l line -d 'summarize with lines rather than commits'
complete -c git -n '__fish_git_using_command summary' -l dedup-by-email -d 'remove duplicate users by the email address'
complete -c git -n '__fish_git_using_command summary' -l no-merges -d 'exclude merge commits'
# release
complete -c git -x -n '__fish_git_using_command release' -s c -d 'Generates/populates the changelog with all commit message since the last tag'
complete -c git -x -n '__fish_git_using_command release' -s r -d 'The "remote" repository that is destination of a push operation'
complete -c git -x -n '__fish_git_using_command release' -s r -d 'The remote repository that is destination of a push operation'
complete -c git -x -n '__fish_git_using_command release' -s m -d 'use the custom commit information instead of the default message'
complete -c git -x -n '__fish_git_using_command release' -s s -d 'Create a signed and annotated tag'
complete -c git -x -n '__fish_git_using_command release' -s u -d 'Create a tag, annotated and signed with the given key'
@ -183,5 +218,3 @@ complete -c git -x -n '__fish_git_using_command release' -l no-empty-commit -d '
# undo
complete -c git -x -n '__fish_git_using_command undo' -s s -l soft -d 'only rolls back the commit but changes remain un-staged'
complete -c git -x -n '__fish_git_using_command undo' -s h -l hard -d 'wipes your commit(s)'

View file

@ -3,7 +3,9 @@
#
is_git_repo() {
git rev-parse --show-toplevel > /dev/null 2>&1
# --git-dir succeeds for both normal and bare repositories, whereas
# --show-toplevel fails inside a bare repository (it has no working tree).
git rev-parse --git-dir > /dev/null 2>&1
result=$?
if test $result != 0; then
>&2 echo 'Not a git repo!'

View file

@ -39,13 +39,34 @@ goto :defaultpath
rem remove the last slash
SET bindir=%bindir:~0,-1%
for %%G in ("%bindir%") do set installdir=%%~dpG
set PREFIX=%installdir%mingw64
rem strip a trailing slash so we can inspect the leaf directory name
if "%installdir:~-1%"=="\" set installdir=%installdir:~0,-1%
rem git.exe found under <GitRoot>\mingw64\bin or <GitRoot>\clangarm64\bin
rem means installdir already is the architecture directory itself
for %%G in ("%installdir%") do set archdir=%%~nxG
if /I "%archdir%"=="mingw64" (
set PREFIX=%installdir%
) else if /I "%archdir%"=="clangarm64" (
set PREFIX=%installdir%
) else if exist "%installdir%\mingw64" (
set PREFIX=%installdir%\mingw64
) else if exist "%installdir%\clangarm64" (
set PREFIX=%installdir%\clangarm64
) else (
set PREFIX=%installdir%\mingw64
)
goto :foundprefix
:defaultpath
:: default for Git for Windows 2.x
if exist "%ProgramFiles%\Git" (
set PREFIX=%ProgramFiles%\Git\mingw64
if exist "%ProgramFiles%\Git\mingw64" (
set PREFIX=%ProgramFiles%\Git\mingw64
) else if exist "%ProgramFiles%\Git\clangarm64" (
set PREFIX=%ProgramFiles%\Git\clangarm64
) else (
set PREFIX=%ProgramFiles%\Git\mingw64
)
)
:foundprefix
@ -55,9 +76,11 @@ IF NOT "%~1"=="" (
REM just supplying the git dir is enough...
if exist "%~1\mingw64" (
set PREFIX=%~1\mingw64
) else if exist "%~1\clangarm64" (
set PREFIX=%~1\clangarm64
) else (
echo Using git install path "%~1" as PREFIX, please make sure it's really a
echo path to the mingw64 directory...
echo path to the mingw64 or clangarm64 directory...
echo.
SET PREFIX=%~1
)
@ -72,12 +95,14 @@ set GIT_INSTALL_DIR=!GIT_INSTALL_DIR:"=!
IF %GIT_INSTALL_DIR:~-1%==\ SET GIT_INSTALL_DIR=%GIT_INSTALL_DIR:~0,-1%
if not exist "%GIT_INSTALL_DIR%\mingw64" (
echo No mingw64 folder found in %GIT_INSTALL_DIR%.
echo.
echo Please supply a proper "Git for Windows 2.x" install path:
echo "install.cmd c:\[git-install-path]"
set ERROR=1
goto :exit
if not exist "%GIT_INSTALL_DIR%\clangarm64" (
echo No mingw64 or clangarm64 folder found in %GIT_INSTALL_DIR%.
echo.
echo Please supply a proper "Git for Windows 2.x" install path:
echo "install.cmd c:\[git-install-path]"
set ERROR=1
goto :exit
)
)
echo Installing to %PREFIX%
@ -116,7 +141,7 @@ FOR /R "%GITEXTRAS%\bin" %%i in (*.*) DO (
TYPE "%GITEXTRAS%\helper\reset-env" >> "%PREFIX%\bin\%%~ni"
TYPE "%GITEXTRAS%\helper\git-extra-utility" >> "%PREFIX%\bin\%%~ni"
TYPE "%GITEXTRAS%\helper\is-git-repo" >> "%PREFIX%\bin\%%~ni"
REM Added /E option for installation fix on Windows 10.0.17134 and higher
MORE /E +2 "%GITEXTRAS%\bin\%%~ni" >> "%PREFIX%\bin\%%~ni"
)
@ -127,7 +152,7 @@ FOR %%i in (%COMMANDS_WITHOUT_REPO%) DO (
ECHO #^^!/usr/bin/env bash > "%PREFIX%\bin\%%i"
TYPE "%GITEXTRAS%\helper\reset-env" >> "%PREFIX%\bin\%%i"
TYPE "%GITEXTRAS%\helper\git-extra-utility" >> "%PREFIX%\bin\%%i"
REM Added /E option for installation fix on Windows 10.0.17134 and higher
MORE /E +2 "%GITEXTRAS%\bin\%%i" >> "%PREFIX%\bin\%%i"
)

View file

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "GIT\-ALIAS" "1" "August 2021" "" "Git Extras"
.TH "GIT\-ALIAS" "1" "September 2024" "" "Git Extras"
.SH "NAME"
\fBgit\-alias\fR \- Define, search and show aliases
.SH "SYNOPSIS"
@ -9,9 +9,30 @@
\fBgit\-alias\fR <search\-pattern>
.br
\fBgit\-alias\fR <alias\-name> <command>
.br
\fBgit\-alias\fR [\-\-global]
.br
\fBgit\-alias\fR [\-\-local]
.br
\fBgit\-alias\fR [\-\-global] <search\-pattern>
.br
\fBgit\-alias\fR [\-\-local] <search\-pattern>
.br
\fBgit\-alias\fR [\-\-global] <alias\-name> <command>
.br
\fBgit\-alias\fR [\-\-local] <alias\-name> <command>
.br
.SH "DESCRIPTION"
List all aliases, show one alias, or set one (global) alias\.
List all aliases, show one alias, or set one (global or local) alias\.
.SH "OPTIONS"
\-\-global
.P
Show or create alias in the system config
.P
\-\-local
.P
Show or create alias in the repository config
.P
<search\-pattern>
.P
The pattern used to search aliases\.
@ -46,8 +67,8 @@ $ git alias
s = status
amend = commit \-\-amend
rank = shortlog \-sn \-\-no\-merges
whatis = show \-s \-\-pretty=\'tformat:%h (%s, %ad)\' \-\-date=short
whois = !sh \-c \'git log \-i \-1 \-\-pretty="format:%an <%ae>
whatis = show \-s \-\-pretty='tformat:%h (%s, %ad)' \-\-date=short
whois = !sh \-c 'git log \-i \-1 \-\-pretty="format:%an <%ae>
.fi
.IP "" 0
.SH "AUTHOR"

View file

@ -77,16 +77,30 @@
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-alias</code><br>
<code>git-alias</code> &lt;search-pattern&gt;<br>
<code>git-alias</code> &lt;alias-name&gt; &lt;command&gt;</p>
<p><code>git-alias</code> <br>
<code>git-alias</code> &lt;search-pattern&gt; <br>
<code>git-alias</code> &lt;alias-name&gt; &lt;command&gt; <br>
<code>git-alias</code> [--global] <br>
<code>git-alias</code> [--local] <br>
<code>git-alias</code> [--global] &lt;search-pattern&gt; <br>
<code>git-alias</code> [--local] &lt;search-pattern&gt; <br>
<code>git-alias</code> [--global] &lt;alias-name&gt; &lt;command&gt; <br>
<code>git-alias</code> [--local] &lt;alias-name&gt; &lt;command&gt; <br></p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>List all aliases, show one alias, or set one (global) alias.</p>
<p>List all aliases, show one alias, or set one (global or local) alias.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p>--global</p>
<p>Show or create alias in the system config</p>
<p>--local</p>
<p>Show or create alias in the repository config</p>
<p>&lt;search-pattern&gt;</p>
<p>The pattern used to search aliases.</p>
@ -136,7 +150,7 @@ whois = !sh -c 'git log -i -1 --pretty="format:%an &lt;%ae&gt;
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>August 2021</li>
<li class='tc'>September 2024</li>
<li class='tr'>git-alias(1)</li>
</ol>

View file

@ -3,16 +3,30 @@ git-alias(1) -- Define, search and show aliases
## SYNOPSIS
`git-alias`
`git-alias` &lt;search-pattern&gt;
`git-alias` &lt;alias-name&gt; &lt;command&gt;
`git-alias` <br>
`git-alias` &lt;search-pattern&gt; <br>
`git-alias` &lt;alias-name&gt; &lt;command&gt; <br>
`git-alias` [--global] <br>
`git-alias` [--local] <br>
`git-alias` [--global] &lt;search-pattern&gt; <br>
`git-alias` [--local] &lt;search-pattern&gt; <br>
`git-alias` [--global] &lt;alias-name&gt; &lt;command&gt; <br>
`git-alias` [--local] &lt;alias-name&gt; &lt;command&gt; <br>
## DESCRIPTION
List all aliases, show one alias, or set one (global) alias.
List all aliases, show one alias, or set one (global or local) alias.
## OPTIONS
--global
Show or create alias in the system config
--local
Show or create alias in the repository config
&lt;search-pattern&gt;
The pattern used to search aliases.

View file

@ -1,6 +1,6 @@
.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "GIT\-ARCHIVE\-FILE" "1" "May 2020" "" "Git Extras"
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "GIT\-ARCHIVE\-FILE" "1" "March 2026" "" "Git Extras"
.SH "NAME"
\fBgit\-archive\-file\fR \- Export the current HEAD of the git repository to an archive
.SH "SYNOPSIS"
@ -14,11 +14,11 @@ Archive naming conventions:
.P
On any branch: \fBgit\-extras\.1\.7\.0\-110\-gafefba7\.branch\-name\.zip\fR
.P
On master branch: \fBgit\-extras\.1\.7\.0\-110\-gafefba7\.zip\fR
On the default branch: \fBgit\-extras\.1\.7\.0\-110\-gafefba7\.zip\fR
.P
On a detached HEAD (e\.g\. a tag): \fBgit\-extras\.1\.7\.0\.zip\fR
.P
The \'/\' and \'\e\' in the branch name will be converted into \'\-\'\.
The '/' and '\e' in the branch name will be converted into '\-'\.
.SH "AUTHOR"
Written by Philipp Klose <\fIme@thehippo\.de\fR>
.SH "REPORTING BUGS"

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' content='text/html;charset=utf8'>
<meta name='generator' content='Ronn-NG/v0.9.1 (http://github.com/apjanke/ronn-ng/tree/0.9.1)'>
<meta http-equiv='content-type' content='text/html;charset=utf-8'>
<meta name='generator' content='Ronn-NG/v0.10.1 (http://github.com/apjanke/ronn-ng/tree/0.10.1)'>
<title>git-archive-file(1) - Export the current HEAD of the git repository to an archive</title>
<style type='text/css' media='all'>
/* style: man */
@ -93,7 +93,7 @@
<p>On any branch: <code>git-extras.1.7.0-110-gafefba7.branch-name.zip</code></p>
<p>On master branch: <code>git-extras.1.7.0-110-gafefba7.zip</code></p>
<p>On the default branch: <code>git-extras.1.7.0-110-gafefba7.zip</code></p>
<p>On a detached HEAD (e.g. a tag): <code>git-extras.1.7.0.zip</code></p>
@ -113,7 +113,7 @@
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>May 2020</li>
<li class='tc'>March 2026</li>
<li class='tr'>git-archive-file(1)</li>
</ol>

View file

@ -20,7 +20,7 @@ Archive naming conventions:
On any branch: `git-extras.1.7.0-110-gafefba7.branch-name.zip`
On master branch: `git-extras.1.7.0-110-gafefba7.zip`
On the default branch: `git-extras.1.7.0-110-gafefba7.zip`
On a detached HEAD (e.g. a tag): `git-extras.1.7.0.zip`

View file

@ -1,87 +1,59 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-AUTHORS" "1" "October 2017" "" "Git Extras"
.
.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "GIT\-AUTHORS" "1" "November 2023" "" "Git Extras"
.SH "NAME"
\fBgit\-authors\fR \- Generate authors report
.
.SH "SYNOPSIS"
\fBgit\-authors\fR [\-l, \-\-list] [\-\-no\-email]
.
.SH "DESCRIPTION"
Populates the file matching \fIauthors|contributors \-i\fR with the authors of commits, according to the number of commits per author\. Opens the file in \fB$EDITOR\fR when set\.
.
.TS
allbox;
Populates the file matching _authors contributors \-i_ with the authors of commits, according to the number of commits per author\.
.TE
.P
See the "MAPPING AUTHORS" section of \fBgit\-shortlog\fR(1) to coalesce together commits by the same person\.
.
.SH "OPTIONS"
\-l, \-\-list
.
.P
Show authors\.
.
.P
\-\-no\-email
.
.P
Don\'t show authors\' email\.
.
.SH "EXAMPLES"
.
.TP
Updating AUTHORS file:
.
.IP
$ git authors
.
.TP
Listing authors:
.
.IP
$ git authors \-\-list
.
.IP "" 4
.
.nf
$ git authors
.fi
.IP "" 0
.P
Listing authors:
.IP "" 4
.nf
$ git authors \-\-list
TJ Holowaychuk <tj@vision\-media\.ca>
hemanth\.hm <hemanth\.hm@gmail\.com>
Jonhnny Weslley <jw@jonhnnyweslley\.net>
nickl\- <github@jigsoft\.co\.za>
Leila Muhtasib <muhtasib@gmail\.com>
.
.fi
.
.IP "" 0
.
.TP
.P
Listing authors without email:
.
.IP
$ git authors \-\-list \-\-no\-email
.
.IP "" 4
.
.nf
$ git authors \-\-list \-\-no\-email
TJ Holowaychuk
hemanth\.hm
Jonhnny Weslley
nickl\-
Leila Muhtasib
.
.fi
.
.IP "" 0
.
.SH "AUTHOR"
Written by Titus Wormer <\fItituswormer@gmail\.com\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<meta http-equiv='content-type' content='text/html;charset=utf8'>
<meta name='generator' content='Ronn-NG/v0.9.1 (http://github.com/apjanke/ronn-ng/tree/0.9.1)'>
<title>git-authors(1) - Generate authors report</title>
<style type='text/css' media='all'>
/* style: man */
@ -69,64 +69,69 @@
<li class='tr'>git-authors(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-authors</code> - <span class="man-whatis">Generate authors report</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-authors</code> [-l, --list] [--no-email]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p> Populates the file matching <em>authors|contributors -i</em> with the authors of commits, according to the number of commits per author.
Opens the file in <strong>$EDITOR</strong> when set.</p>
<table>
<tbody>
<tr>
<td>Populates the file matching _authors</td>
<td>contributors -i_ with the authors of commits, according to the number of commits per author.</td>
</tr>
</tbody>
</table>
<p> See the "MAPPING AUTHORS" section of <strong>git-shortlog</strong>(1) to coalesce together commits by the same person.</p>
<p>See the "MAPPING AUTHORS" section of <strong>git-shortlog</strong>(1) to coalesce together commits by the same person.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p> -l, --list</p>
<p>-l, --list</p>
<p> Show authors.</p>
<p>Show authors.</p>
<p> --no-email</p>
<p>--no-email</p>
<p> Don't show authors' email.</p>
<p>Don't show authors' email.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<dl>
<dt>Updating AUTHORS file:</dt><dd><p></p>
<p>Updating AUTHORS file:</p>
<p>$ git authors</p></dd>
<dt>Listing authors:</dt><dd><p></p>
<pre><code>$ git authors
</code></pre>
<p>$ git authors --list</p>
<p>Listing authors:</p>
<pre><code>TJ Holowaychuk &lt;tj@vision-media.ca&gt;
<pre><code>$ git authors --list
TJ Holowaychuk &lt;tj@vision-media.ca&gt;
hemanth.hm &lt;hemanth.hm@gmail.com&gt;
Jonhnny Weslley &lt;jw@jonhnnyweslley.net&gt;
nickl- &lt;github@jigsoft.co.za&gt;
Leila Muhtasib &lt;muhtasib@gmail.com&gt;
</code></pre></dd>
<dt>Listing authors without email:</dt><dd><p></p>
</code></pre>
<p>$ git authors --list --no-email</p>
<p>Listing authors without email:</p>
<pre><code>TJ Holowaychuk
<pre><code>$ git authors --list --no-email
TJ Holowaychuk
hemanth.hm
Jonhnny Weslley
nickl-
Leila Muhtasib
</code></pre></dd>
</dl>
</code></pre>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Titus Wormer &lt;<a href="&#x6d;&#x61;&#x69;&#x6c;&#116;&#111;&#58;&#x74;&#105;&#116;&#x75;&#x73;&#x77;&#x6f;&#x72;&#x6d;&#x65;&#114;&#64;&#103;&#109;&#97;&#x69;&#108;&#46;&#99;&#111;&#x6d;" data-bare-link="true">&#x74;&#105;&#116;&#x75;&#x73;&#x77;&#111;&#114;&#109;&#101;&#x72;&#64;&#103;&#x6d;&#x61;&#x69;&#108;&#x2e;&#99;&#x6f;&#x6d;</a>&gt;</p>
<p>Written by Titus Wormer &lt;<a href="mailto:tituswormer@gmail.com" data-bare-link="true">tituswormer@gmail.com</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
@ -136,10 +141,9 @@ Leila Muhtasib
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>October 2017</li>
<li class='tc'>November 2023</li>
<li class='tr'>git-authors(1)</li>
</ol>

View file

@ -8,7 +8,6 @@ git-authors(1) -- Generate authors report
## DESCRIPTION
Populates the file matching _authors|contributors -i_ with the authors of commits, according to the number of commits per author.
Opens the file in **$EDITOR** when set.
See the "MAPPING AUTHORS" section of **git-shortlog**(1) to coalesce together commits by the same person.
@ -24,33 +23,27 @@ git-authors(1) -- Generate authors report
## EXAMPLES
* Updating AUTHORS file:
Updating AUTHORS file:
$ git authors
* Listing authors:
Listing authors:
$ git authors --list
```
TJ Holowaychuk <tj@vision-media.ca>
hemanth.hm <hemanth.hm@gmail.com>
Jonhnny Weslley <jw@jonhnnyweslley.net>
nickl- <github@jigsoft.co.za>
Leila Muhtasib <muhtasib@gmail.com>
```
* Listing authors without email:
Listing authors without email:
$ git authors --list --no-email
```
TJ Holowaychuk
hemanth.hm
Jonhnny Weslley
nickl-
Leila Muhtasib
```
## AUTHOR

View file

@ -1,34 +1,23 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-BROWSE\-CI" "1" "March 2022" "" "Git Extras"
.
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "GIT\-BROWSE\-CI" "1" "March 2026" "" "Git Extras"
.SH "NAME"
\fBgit\-browse\-ci\fR \-
.
\fBgit\-browse\-ci\fR \- View the CI page for the current repository
.SH "SYNOPSIS"
\fBgit\-browse\-ci\fR [remote_name]
.
\fBgit\-browse\-ci\fR [<remote_name>]
.SH "DESCRIPTION"
Opens the current git repository CI page in your default web browser\.
.
.SH "OPTIONS"
<remote_name>
.
.P
The name of the remote you wish to browse to\. Defaults to the first remote if not specified\.
.
The name of the remote you wish to browse to\. Defaults to the current branch's configured remote, or \fBorigin\fR if not specified\.
.SH "EXAMPLES"
$ git browse\-ci
.
.P
$ git browse\-ci upstream
.
.SH "AUTHOR"
Written by Peter Benjamin <\fIhttps://github\.com/pbnj\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

View file

@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>git-browse-ci(1) - &lt;View the web page for the current repository&gt;</title>
<meta http-equiv='content-type' content='text/html;charset=utf-8'>
<meta name='generator' content='Ronn-NG/v0.10.1 (http://github.com/apjanke/ronn-ng/tree/0.10.1)'>
<title>git-browse-ci(1) - View the CI page for the current repository</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
@ -69,14 +69,15 @@
<li class='tr'>git-browse-ci(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-browse-ci</code> - <span class="man-whatis"><view the web page for current repository /></span>
</p>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-browse-ci</code> - <span class="man-whatis">View the CI page for the current repository</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-browse-ci</code> [remote_name]</p>
<p><code>git-browse-ci</code> [&lt;remote_name&gt;]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@ -86,14 +87,14 @@
<p>&lt;remote_name&gt;</p>
<p>The name of the remote you wish to browse to. Defaults to
the first remote if not specified.</p>
<p>The name of the remote you wish to browse to. Defaults to the current
branch's configured remote, or <code>origin</code> if not specified.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<p> $ git browse-ci</p>
<p>$ git browse-ci</p>
<p> $ git browse-ci upstream</p>
<p>$ git browse-ci upstream</p>
<h2 id="AUTHOR">AUTHOR</h2>
@ -107,10 +108,9 @@ the first remote if not specified.</p>
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>March 2022</li>
<li class='tc'>March 2026</li>
<li class='tr'>git-browse-ci(1)</li>
</ol>

View file

@ -1,9 +1,9 @@
git-browse-ci(1) -- <View the web page for the current repository>
git-browse-ci(1) -- View the CI page for the current repository
================================
## SYNOPSIS
`git-browse-ci` [remote_name]
`git-browse-ci` [&lt;remote_name&gt;]
## DESCRIPTION
@ -13,8 +13,8 @@ Opens the current git repository CI page in your default web browser.
&lt;remote_name&gt;
The name of the remote you wish to browse to. Defaults to
the first remote if not specified.
The name of the remote you wish to browse to. Defaults to the current
branch's configured remote, or `origin` if not specified.
## EXAMPLES

View file

@ -1,61 +1,41 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-BROWSE" "1" "June 2022" "" "Git Extras"
.
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "GIT\-BROWSE" "1" "March 2026" "" "Git Extras"
.SH "NAME"
\fBgit\-browse\fR \-
.
\fBgit\-browse\fR \- View the web page for the current repository
.SH "SYNOPSIS"
\fBgit\-browse\fR [remote_name] [file_name] [line_1] [line_2]
.
\fBgit\-browse\fR [REMOTE\-NAME] [FILE\-NAME] [LINE\-1] [LINE\-2]
.SH "DESCRIPTION"
Opens the current git repository website in your default web browser\.
.
.SH "OPTIONS"
<remote_name>
.
REMOTE\-NAME
.P
The name of the remote you wish to browse to\. Defaults to the first remote if not specified\.
.
.P
<file_name>
.
FILE\-NAME
.P
The name of the file you wish to browse to\.
.
.P
<line_1>
.
LINE\-1
.P
The line number of the file you wish to browse to\.
.
.P
<line_2>
.
LINE\-2
.P
The line range (from <line_1> to <line_2>) of the file you wish to browse to\.
.
The line range (from LINE\-1 to LINE\-2) of the file you wish to browse to\.
.SH "EXAMPLES"
$ git browse
.
.P
$ git browse upstream
.
.P
$ git browse upstream bin/git\-browse
.
.P
$ git browse upstream bin/git\-browse 42
.
.P
$ git browse upstream bin/git\-browse 1 42
.
.SH "AUTHOR"
Written by Mark Pitman <\fIhttps://github\.com/mapitman\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

View file

@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>git-browse(1) - &lt;View the web page for the current repository&gt;</title>
<meta http-equiv='content-type' content='text/html;charset=utf-8'>
<meta name='generator' content='Ronn-NG/v0.10.1 (http://github.com/apjanke/ronn-ng/tree/0.10.1)'>
<title>git-browse(1) - View the web page for the current repository</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
@ -69,14 +69,15 @@
<li class='tr'>git-browse(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-browse</code> - <span class="man-whatis"><view the web page for current repository /></span>
</p>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-browse</code> - <span class="man-whatis">View the web page for the current repository</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-browse</code> [remote_name] [file_name] [line_1] [line_2]</p>
<p><code>git-browse</code> [REMOTE-NAME] [FILE-NAME] [LINE-1] [LINE-2]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@ -84,35 +85,35 @@
<h2 id="OPTIONS">OPTIONS</h2>
<p>&lt;remote_name&gt;</p>
<p>REMOTE-NAME</p>
<p>The name of the remote you wish to browse to. Defaults to
the first remote if not specified.</p>
<p>&lt;file_name&gt;</p>
<p>FILE-NAME</p>
<p>The name of the file you wish to browse to.</p>
<p>&lt;line_1&gt;</p>
<p>LINE-1</p>
<p>The line number of the file you wish to browse to.</p>
<p>&lt;line_2&gt;</p>
<p>LINE-2</p>
<p>The line range (from &lt;line_1&gt; to &lt;line_2&gt;) of the file you wish to
<p>The line range (from LINE-1 to LINE-2) of the file you wish to
browse to.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<p> $ git browse</p>
<p>$ git browse</p>
<p> $ git browse upstream</p>
<p>$ git browse upstream</p>
<p> $ git browse upstream bin/git-browse</p>
<p>$ git browse upstream bin/git-browse</p>
<p> $ git browse upstream bin/git-browse 42</p>
<p>$ git browse upstream bin/git-browse 42</p>
<p> $ git browse upstream bin/git-browse 1 42</p>
<p>$ git browse upstream bin/git-browse 1 42</p>
<h2 id="AUTHOR">AUTHOR</h2>
@ -126,10 +127,9 @@ browse to.</p>
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>June 2022</li>
<li class='tc'>March 2026</li>
<li class='tr'>git-browse(1)</li>
</ol>

View file

@ -1,9 +1,9 @@
git-browse(1) -- <View the web page for the current repository>
git-browse(1) -- View the web page for the current repository
================================
## SYNOPSIS
`git-browse` [remote_name] [file_name] [line_1] [line_2]
`git-browse` [REMOTE-NAME] [FILE-NAME] [LINE-1] [LINE-2]
## DESCRIPTION
@ -11,22 +11,22 @@ Opens the current git repository website in your default web browser.
## OPTIONS
&lt;remote_name&gt;
REMOTE-NAME
The name of the remote you wish to browse to. Defaults to
the first remote if not specified.
&lt;file_name&gt;
FILE-NAME
The name of the file you wish to browse to.
&lt;line_1&gt;
LINE-1
The line number of the file you wish to browse to.
&lt;line_2&gt;
LINE-2
The line range (from &lt;line_1&gt; to &lt;line_2&gt;) of the file you wish to
The line range (from LINE-1 to LINE-2) of the file you wish to
browse to.
## EXAMPLES

View file

@ -1,17 +1,23 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-BRV" "1" "January 2020" "" "Git Extras"
.TH "GIT\-BRV" "1" "December 2023" "" "Git Extras"
.
.SH "NAME"
\fBgit\-brv\fR \- List branches sorted by their last commit date
.
.SH "SYNOPSIS"
\fBgit\-brv\fR
\fBgit\-brv\fR [\-r|\-\-reverse]
.
.SH "DESCRIPTION"
Pretty listing of branches sorted by the date of their last commit\.
.
.SH "OPTIONS"
\-r | \-\-reverse
.
.P
Reverses the output to put the most recent branch at the bottom of the list\. This is useful when there are large amount of branches as the most recent branch is shown just above the next prompt\. This can be configured as the default by setting \fBgit\-extras\.brv\.reverse\fR to true in your git options\.
.
.SH "EXAMPLES"
Simply run \fBgit brv\fR
.
@ -27,6 +33,21 @@ $ git brv
.
.IP "" 0
.
.P
To display the rows in reverse order: \fBgit brv \-\-reverse\fR
.
.IP "" 4
.
.nf
$ git brv \-\-reverse
2020\-01\-08 master origin/master 265b03e Merge pull request #816 from spacewander/git\-sed\-pathspec
2020\-01\-14 adds\-git\-brv fork/adds\-git\-brv 1ca0d76 Fixes #700: Adds git\-brv
.
.fi
.
.IP "" 0
.
.SH "AUTHOR"
Written by Øsse <\fIhttps://github\.com/Osse\fR>
.

View file

@ -56,6 +56,7 @@
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#EXAMPLES">EXAMPLES</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#REPORTING-BUGS">REPORTING BUGS</a>
@ -75,12 +76,18 @@
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-brv</code></p>
<p><code>git-brv</code> [-r|--reverse]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p> Pretty listing of branches sorted by the date of their last commit.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p> -r | --reverse</p>
<p> Reverses the output to put the most recent branch at the bottom of the list. This is useful when there are large amount of branches as the most recent branch is shown just above the next prompt. This can be configured as the default by setting <code>git-extras.brv.reverse</code> to true in your git options.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<p> Simply run <code>git brv</code></p>
@ -90,6 +97,13 @@
2020-01-08 master origin/master 265b03e Merge pull request #816 from spacewander/git-sed-pathspec
</code></pre>
<p> To display the rows in reverse order: <code>git brv --reverse</code></p>
<pre><code>$ git brv --reverse
2020-01-08 master origin/master 265b03e Merge pull request #816 from spacewander/git-sed-pathspec
2020-01-14 adds-git-brv fork/adds-git-brv 1ca0d76 Fixes #700: Adds git-brv
</code></pre>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Øsse &lt;<a href="https://github.com/Osse" data-bare-link="true">https://github.com/Osse</a>&gt;</p>
@ -105,7 +119,7 @@
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>January 2020</li>
<li class='tc'>December 2023</li>
<li class='tr'>git-brv(1)</li>
</ol>

View file

@ -3,12 +3,18 @@ git-brv(1) -- List branches sorted by their last commit date
## SYNOPSIS
`git-brv`
`git-brv` [-r|--reverse]
## DESCRIPTION
Pretty listing of branches sorted by the date of their last commit.
## OPTIONS
-r | --reverse
Reverses the output to put the most recent branch at the bottom of the list. This is useful when there are large amount of branches as the most recent branch is shown just above the next prompt. This can be configured as the default by setting `git-extras.brv.reverse` to true in your git options.
## EXAMPLES
Simply run `git brv`
@ -17,6 +23,11 @@ git-brv(1) -- List branches sorted by their last commit date
2020-01-14 adds-git-brv fork/adds-git-brv 1ca0d76 Fixes #700: Adds git-brv
2020-01-08 master origin/master 265b03e Merge pull request #816 from spacewander/git-sed-pathspec
To display the rows in reverse order: `git brv --reverse`
$ git brv --reverse
2020-01-08 master origin/master 265b03e Merge pull request #816 from spacewander/git-sed-pathspec
2020-01-14 adds-git-brv fork/adds-git-brv 1ca0d76 Fixes #700: Adds git-brv
## AUTHOR

View file

@ -1,108 +1,82 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-BULK" "1" "August 2020" "" "Git Extras"
.
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "GIT\-BULK" "1" "March 2026" "" "Git Extras"
.SH "NAME"
\fBgit\-bulk\fR \- Run git commands on multiple repositories
.
.SH "SYNOPSIS"
git bulk [\-g] ([\-a]|[\-w <ws\-name>]) <git command>
.
.br
git bulk \-\-addworkspace <ws\-name> <ws\-root\-directory> (\-\-from <URL or file>)
.
.br
git bulk \-\-removeworkspace <ws\-name>
.
.br
git bulk \-\-addcurrent <ws\-name>
.
.br
git bulk \-\-purge
.
.br
git bulk \-\-listall
.
.nf
git\-bulk [\-q|\-\-quiet] [\-g] [\-\-no\-follow\-symlinks] [\-\-no\-follow\-hidden] ([\-a]|[\-w WS\-NAME]) GIT\-COMMAND
git\-bulk \-\-addworkspace WS\-NAME WS\-ROOT\-DIRECTORY (\-\-from URL\-OR\-FILE)
git\-bulk \-\-removeworkspace WS\-NAME
git\-bulk \-\-addcurrent WS\-NAME
git\-bulk \-\-purge
git\-bulk \-\-listall
.fi
.SH "DESCRIPTION"
git bulk adds convenient support for operations that you want to execute on multiple git repositories\.
.
.IP "\(bu" 4
simply register workspaces that contain multiple git repos in their directory structure
.
.IP "\(bu" 4
run any git command on the repositories of the registered workspaces in one command to \fBgit bulk\fR
.
.IP "\(bu" 4
use the "guarded mode" to check on each execution
.
.IP "" 0
.
.SH "OPTIONS"
\-a
.
.P
Run a git command on all workspaces and their repositories\.
.
.P
\-g
.
.P
Ask the user for confirmation on every execution\.
.
.P
\-w <ws\-name>
.
\-\-no\-follow\-symlinks
.P
Do not traverse symbolic links under the workspace when searching for git repositories\.
.P
\-\-no\-follow\-hidden
.P
Do not traverse hidden (dotted) directories under the workspace when searching for git repositories\.
.P
\-w WS\-NAME
.P
Run the git command on the specified workspace\. The workspace must be registered\.
.
.P
<git command>
.
GIT\-COMMAND
.P
Any git Command you wish to execute on the repositories\.
.
.P
\-\-addworkspace <ws\-name> <ws\-root\-directory> (\-\-from <URL or file&rt;gt;)
.
\-\-addworkspace WS\-NAME WS\-ROOT\-DIRECTORY (\-\-from URL\-OR\-FILE)
.P
Register a workspace for bulk operations\. All repositories in the directories below <ws\-root\-directory> get registered under this workspace with the name <ws\-name>\. <ws\-root\-directory> must be absolute path\.
.
Register a workspace for bulk operations\. All repositories in the directories below WS\-ROOT\-DIRECTORY get registered under this workspace with the name WS\-NAME\. WS\-ROOT\-DIRECTORY must be an absolute path\.
.P
With option \'\-\-from\' the URL to a single repository or a file containing multiple URLs can be added and they will be cloned directly into the workspace\. Suitable for the initial setup of a multi\-repo project\.
.
With option '\-\-from' the URL to a single repository or a file containing multiple URLs can be added and they will be cloned directly into the workspace\. Suitable for the initial setup of a multi\-repo project\.
.P
\-\-removeworkspace <ws\-name>
.
\-\-removeworkspace WS\-NAME
.P
Remove the workspace with the logical name <ws\-name>\.
.
Remove the workspace with the logical name WS\-NAME\.
.P
\-\-addcurrent <ws\-name>
.
\-\-addcurrent WS\-NAME
.P
Adds the current directory as workspace to git bulk operations\. The workspace is referenced with its logical name <ws\-name>\.
.
Adds the current directory as workspace to git bulk operations\. The workspace is referenced with its logical name WS\-NAME\.
.P
git bulk \-\-purge
.
.P
Removes all defined repository locations\.
.
.P
git bulk \-\-listall
.
.P
List all registered repositories\.
.
.SH "EXAMPLES"
.
.nf
Register a workspace so that git bulk knows about it:
Register a workspace so that git bulk knows about it using an absolute path:
$ git bulk \-\-addworkspace personal ~/workspaces/personal
Or register a workspace using an environment variable pointing to an absolute path:
$ git bulk \-\-addworkspace personal '$PERSONAL_WORKSPACE'
Use option \-\-from in order to directly clone a repository or multiple repositories
$ git bulk \-\-addworkspace personal ~/workspaces/personal \-\-from https://github\.com/tj/git\-extras\.git
@ -142,14 +116,14 @@ $ git bulk \-\-removeworkspace personal
Remove all registered workspaces:
$ git bulk \-\-purge
.
.fi
.
.SH "FILES"
.IP "\(bu" 4
\fB\.gitconfig\fR: Store the \fBgit\-bulk\fR registered workspaces under the \fBbulkworkspaces\fR key\.
.IP "" 0
.SH "AUTHOR"
Written by Niklas Schlimm <\fIns103@hotmail\.de\fR>
.
.SH "REPORTING BUGS"
<https://github\.com/nschlimm/git\-bulk>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<meta http-equiv='content-type' content='text/html;charset=utf-8'>
<meta name='generator' content='Ronn-NG/v0.10.1 (http://github.com/apjanke/ronn-ng/tree/0.10.1)'>
<title>git-bulk(1) - Run git commands on multiple repositories</title>
<style type='text/css' media='all'>
/* style: man */
@ -58,6 +58,7 @@
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#EXAMPLES">EXAMPLES</a>
<a href="#FILES">FILES</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#REPORTING-BUGS">REPORTING BUGS</a>
<a href="#SEE-ALSO">SEE ALSO</a>
@ -69,77 +70,91 @@
<li class='tr'>git-bulk(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-bulk</code> - <span class="man-whatis">Run git commands on multiple repositories</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p>git bulk [-g] ([-a]|[-w &lt;ws-name&gt;]) &lt;git command&gt; <br />
git bulk --addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt; (--from &lt;URL or file&gt;) <br />
git bulk --removeworkspace &lt;ws-name&gt; <br />
git bulk --addcurrent &lt;ws-name&gt; <br />
git bulk --purge <br />
git bulk --listall</p>
<pre><code>git-bulk [-q|--quiet] [-g] [--no-follow-symlinks] [--no-follow-hidden] ([-a]|[-w WS-NAME]) GIT-COMMAND
git-bulk --addworkspace WS-NAME WS-ROOT-DIRECTORY (--from URL-OR-FILE)
git-bulk --removeworkspace WS-NAME
git-bulk --addcurrent WS-NAME
git-bulk --purge
git-bulk --listall
</code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>git bulk adds convenient support for operations that you want to execute on multiple git repositories.</p>
<ul>
<li>simply register workspaces that contain multiple git repos in their directory structure</li>
<li>run any git command on the repositories of the registered workspaces in one command to <code>git bulk</code></li>
<li>use the "guarded mode" to check on each execution</li>
<li>simply register workspaces that contain multiple git repos in their directory structure</li>
<li>run any git command on the repositories of the registered workspaces in one command to <code>git bulk</code>
</li>
<li>use the "guarded mode" to check on each execution</li>
</ul>
<h2 id="OPTIONS">OPTIONS</h2>
<p> -a</p>
<p>-a</p>
<p> Run a git command on all workspaces and their repositories.</p>
<p>Run a git command on all workspaces and their repositories.</p>
<p> -g</p>
<p>-g</p>
<p> Ask the user for confirmation on every execution.</p>
<p>Ask the user for confirmation on every execution.</p>
<p> -w &lt;ws-name&gt;</p>
<p>--no-follow-symlinks</p>
<p> Run the git command on the specified workspace. The workspace must be registered.</p>
<p>Do not traverse symbolic links under the workspace when searching for git repositories.</p>
<p> &lt;git command&gt;</p>
<p>--no-follow-hidden</p>
<p> Any git Command you wish to execute on the repositories.</p>
<p>Do not traverse hidden (dotted) directories under the workspace when searching for git repositories.</p>
<p> --addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt; (--from &lt;URL or file&rt;gt;)</p>
<p>-w WS-NAME</p>
<p> Register a workspace for bulk operations. All repositories in the directories below &lt;ws-root-directory&gt; get registered under this workspace with the name &lt;ws-name&gt;. &lt;ws-root-directory&gt; must be absolute path.</p>
<p>Run the git command on the specified workspace. The workspace must be registered.</p>
<p> With option '--from' the URL to a single repository or a file containing multiple URLs can be added and they will be cloned directly into the workspace. Suitable for the initial setup of a multi-repo project.</p>
<p>GIT-COMMAND</p>
<p> --removeworkspace &lt;ws-name&gt;</p>
<p>Any git Command you wish to execute on the repositories.</p>
<p> Remove the workspace with the logical name &lt;ws-name&gt;.</p>
<p>--addworkspace WS-NAME WS-ROOT-DIRECTORY (--from URL-OR-FILE)</p>
<p> --addcurrent &lt;ws-name&gt;</p>
<p>Register a workspace for bulk operations. All repositories in the directories below WS-ROOT-DIRECTORY get registered under this workspace with the name WS-NAME. WS-ROOT-DIRECTORY must be an absolute path.</p>
<p> Adds the current directory as workspace to git bulk operations. The workspace is referenced with its logical name &lt;ws-name&gt;.</p>
<p>With option '--from' the URL to a single repository or a file containing multiple URLs can be added and they will be cloned directly into the workspace. Suitable for the initial setup of a multi-repo project.</p>
<p> git bulk --purge</p>
<p>--removeworkspace WS-NAME</p>
<p> Removes all defined repository locations.</p>
<p>Remove the workspace with the logical name WS-NAME.</p>
<p> git bulk --listall</p>
<p>--addcurrent WS-NAME</p>
<p> List all registered repositories.</p>
<p>Adds the current directory as workspace to git bulk operations. The workspace is referenced with its logical name WS-NAME.</p>
<p>git bulk --purge</p>
<p>Removes all defined repository locations.</p>
<p>git bulk --listall</p>
<p>List all registered repositories.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<pre><code>Register a workspace so that git bulk knows about it:
<pre><code>Register a workspace so that git bulk knows about it using an absolute path:
$ git bulk --addworkspace personal ~/workspaces/personal
Or register a workspace using an environment variable pointing to an absolute path:
$ git bulk --addworkspace personal '$PERSONAL_WORKSPACE'
Use option --from in order to directly clone a repository or multiple repositories
$ git bulk --addworkspace personal ~/workspaces/personal --from https://github.com/tj/git-extras.git
@ -181,9 +196,16 @@ Remove all registered workspaces:
$ git bulk --purge
</code></pre>
<h2 id="FILES">FILES</h2>
<ul>
<li>
<code>.gitconfig</code>: Store the <code>git-bulk</code> registered workspaces under the <code>bulkworkspaces</code> key.</li>
</ul>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Niklas Schlimm &lt;<a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#58;&#x6e;&#x73;&#x31;&#48;&#51;&#x40;&#x68;&#111;&#116;&#x6d;&#97;&#105;&#108;&#x2e;&#100;&#101;" data-bare-link="true">&#110;&#x73;&#x31;&#x30;&#51;&#x40;&#104;&#111;&#116;&#x6d;&#97;&#105;&#108;&#46;&#x64;&#x65;</a>&gt;</p>
<p>Written by Niklas Schlimm &lt;<a href="mailto:ns103@hotmail.de" data-bare-link="true">ns103@hotmail.de</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
@ -193,10 +215,9 @@ $ git bulk --purge
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>August 2020</li>
<li class='tc'>March 2026</li>
<li class='tr'>git-bulk(1)</li>
</ol>

View file

@ -3,12 +3,12 @@ git-bulk(1) -- Run git commands on multiple repositories
## SYNOPSIS
git bulk [-g] ([-a]|[-w &lt;ws-name&gt;]) &lt;git command&gt; <br/>
git bulk --addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt; (--from &lt;URL or file&gt;) <br/>
git bulk --removeworkspace &lt;ws-name&gt; <br/>
git bulk --addcurrent &lt;ws-name&gt; <br/>
git bulk --purge <br/>
git bulk --listall
git-bulk [-q|--quiet] [-g] [--no-follow-symlinks] [--no-follow-hidden] ([-a]|[-w WS-NAME]) GIT-COMMAND
git-bulk --addworkspace WS-NAME WS-ROOT-DIRECTORY (--from URL-OR-FILE)
git-bulk --removeworkspace WS-NAME
git-bulk --addcurrent WS-NAME
git-bulk --purge
git-bulk --listall
## DESCRIPTION
@ -28,27 +28,35 @@ git bulk adds convenient support for operations that you want to execute on mult
Ask the user for confirmation on every execution.
-w &lt;ws-name&gt;
--no-follow-symlinks
Do not traverse symbolic links under the workspace when searching for git repositories.
--no-follow-hidden
Do not traverse hidden (dotted) directories under the workspace when searching for git repositories.
-w WS-NAME
Run the git command on the specified workspace. The workspace must be registered.
&lt;git command&gt;
GIT-COMMAND
Any git Command you wish to execute on the repositories.
--addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt; (--from &lt;URL or file&rt;gt;)
--addworkspace WS-NAME WS-ROOT-DIRECTORY (--from URL-OR-FILE)
Register a workspace for bulk operations. All repositories in the directories below &lt;ws-root-directory&gt; get registered under this workspace with the name &lt;ws-name&gt;. &lt;ws-root-directory&gt; must be absolute path.
Register a workspace for bulk operations. All repositories in the directories below WS-ROOT-DIRECTORY get registered under this workspace with the name WS-NAME. WS-ROOT-DIRECTORY must be an absolute path.
With option '--from' the URL to a single repository or a file containing multiple URLs can be added and they will be cloned directly into the workspace. Suitable for the initial setup of a multi-repo project.
--removeworkspace &lt;ws-name&gt;
--removeworkspace WS-NAME
Remove the workspace with the logical name &lt;ws-name&gt;.
Remove the workspace with the logical name WS-NAME.
--addcurrent &lt;ws-name&gt;
--addcurrent WS-NAME
Adds the current directory as workspace to git bulk operations. The workspace is referenced with its logical name &lt;ws-name&gt;.
Adds the current directory as workspace to git bulk operations. The workspace is referenced with its logical name WS-NAME.
git bulk --purge
@ -60,10 +68,14 @@ git bulk adds convenient support for operations that you want to execute on mult
## EXAMPLES
Register a workspace so that git bulk knows about it:
Register a workspace so that git bulk knows about it using an absolute path:
$ git bulk --addworkspace personal ~/workspaces/personal
Or register a workspace using an environment variable pointing to an absolute path:
$ git bulk --addworkspace personal '$PERSONAL_WORKSPACE'
Use option --from in order to directly clone a repository or multiple repositories
$ git bulk --addworkspace personal ~/workspaces/personal --from https://github.com/tj/git-extras.git
@ -104,6 +116,10 @@ git bulk adds convenient support for operations that you want to execute on mult
$ git bulk --purge
## FILES
- `.gitconfig`: Store the `git-bulk` registered workspaces under the `bulkworkspaces` key.
## AUTHOR
Written by Niklas Schlimm &lt;<ns103@hotmail.de>&gt;

View file

@ -1,57 +1,52 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-COMMITS\-SINCE" "1" "October 2017" "" "Git Extras"
.
.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "GIT\-COMMITS\-SINCE" "1" "January 2026" "" "Git Extras"
.SH "NAME"
\fBgit\-commits\-since\fR \- Show commit logs since some date
.
.SH "SYNOPSIS"
\fBgit\-commits\-since\fR [<date>]
.
.TS
allbox;
\fBgit\-commits\-since\fR [\-r \-\-ref <ref>] [<date>]
.TE
.SH "DESCRIPTION"
List of commits since the given \fIdate\fR\.
.
List of commits since the given \fIdate\fR or \fIref\fR\.
.SH "OPTIONS"
<date>
.
.P
Show commits more recent than \fIdate\fR\. By default, the command shows the commit logs since "last week"\.
.
Show commits more recent than <date>\. By default, the command shows the commit logs since "last week"\.
.P
\-r, \-\-ref <ref>
.P
Show commits since the given ref (tag, branch, or commit)\. When specified, the command uses \fBref\.\.HEAD\fR instead of date\-based filtering\.
.SH "EXAMPLES"
It is really flexible and these are only 3 of the options, go ahead give it a try:
.
.IP "" 4
.
.nf
$ git commits\-since yesterday
\.\.\. commits since yesterday
nickl\- \- Merge branch upstream master\.
nickl\- \- Rebase bolshakov with master
TJ Holowaychuk \- Merge pull request #128 from nickl\-/git\-extras\-html\-hyperlinks
TJ Holowaychuk \- Merge pull request #129 from nickl\-/develop
nickl\- \- Fix #127 git\-ignore won\'t add duplicates\.
aa084d9 TweeKane \- Add global gitignore to git\-ignore output
515e94a TJ Holowaychuk \- Merge pull request #128 from nickl\-/git\-extras\-html\-hyperlinks
5f86b54 TJ Holowaychuk \- Merge pull request #129 from nickl\-/develop
7398d10 nickl\- \- Fix #127 git\-ignore won\'t add duplicates\.
$ git commits\-since 3 o clock pm
\.\.\. commits since 3 o clock pm
nickl\- \- Merge branch upstream master\.
aa084d9 TweeKane \- Add global gitignore to git\-ignore output
$ git commits\-since 2 hour ago
\.\.\. commits since 2 hour ago
nickl\- \- Merge branch upstream master\.
TJ Holowaychuk \- Merge pull request #128 from nickl\-/git\-extras\-html\-hyperlinks
TJ Holowaychuk \- Merge pull request #129 from nickl\-/develop
.
aa084d9 TweeKane \- Add global gitignore to git\-ignore output
515e94a TJ Holowaychuk \- Merge pull request #128 from nickl\-/git\-extras\-html\-hyperlinks
5f86b54 TJ Holowaychuk \- Merge pull request #129 from nickl\-/develop
$ git commits\-since \-\-ref 7\.4\.0
6ed2643 John Bachir \- ability to specify command when hitting enter (#1223)
b9bd309 John Bachir \- Improve `git\-repl` prompt (#1224)
6f4cf0c johnpyp \- feat: `delete\-branch` multiple unique branch names completions (#1221)
\|\.\|\.\|\.
215382b 罗泽轩 \- Bump version to 7\.5\.0\-dev (#1207)
.fi
.
.IP "" 0
.
.SH "AUTHOR"
Written by Tj Holowaychuk <\fItj@vision\-media\.ca\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<meta http-equiv='content-type' content='text/html;charset=utf8'>
<meta name='generator' content='Ronn-NG/v0.9.1 (http://github.com/apjanke/ronn-ng/tree/0.9.1)'>
<title>git-commits-since(1) - Show commit logs since some date</title>
<style type='text/css' media='all'>
/* style: man */
@ -69,51 +69,67 @@
<li class='tr'>git-commits-since(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-commits-since</code> - <span class="man-whatis">Show commit logs since some date</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-commits-since</code> [&lt;date&gt;]</p>
<table>
<tbody>
<tr>
<td>
<code>git-commits-since</code> [-r</td>
<td>--ref &lt;ref&gt;] [&lt;date&gt;]</td>
</tr>
</tbody>
</table>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p> List of commits since the given <em>date</em>.</p>
<p>List of commits since the given <em>date</em> or <em>ref</em>.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p> &lt;date&gt;</p>
<p>&lt;date&gt;</p>
<p> Show commits more recent than <var>date</var>. By default, the command shows the commit logs since "last week".</p>
<p>Show commits more recent than &lt;date&gt;. By default, the command shows the commit logs since "last week".</p>
<p>-r, --ref &lt;ref&gt;</p>
<p>Show commits since the given ref (tag, branch, or commit). When specified, the command uses <code>ref..HEAD</code> instead of date-based filtering.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<p> It is really flexible and these are only 3 of the options, go ahead give it a try:</p>
<p>It is really flexible and these are only 3 of the options, go ahead give it a try:</p>
<pre><code>$ git commits-since yesterday
... commits since yesterday
nickl- - Merge branch upstream master.
nickl- - Rebase bolshakov with master
TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
TJ Holowaychuk - Merge pull request #129 from nickl-/develop
nickl- - Fix #127 git-ignore won't add duplicates.
aa084d9 TweeKane - Add global gitignore to git-ignore output
515e94a TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
5f86b54 TJ Holowaychuk - Merge pull request #129 from nickl-/develop
7398d10 nickl- - Fix #127 git-ignore won't add duplicates.
$ git commits-since 3 o clock pm
... commits since 3 o clock pm
nickl- - Merge branch upstream master.
aa084d9 TweeKane - Add global gitignore to git-ignore output
$ git commits-since 2 hour ago
... commits since 2 hour ago
nickl- - Merge branch upstream master.
TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
TJ Holowaychuk - Merge pull request #129 from nickl-/develop
aa084d9 TweeKane - Add global gitignore to git-ignore output
515e94a TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
5f86b54 TJ Holowaychuk - Merge pull request #129 from nickl-/develop
$ git commits-since --ref 7.4.0
6ed2643 John Bachir - ability to specify command when hitting enter (#1223)
b9bd309 John Bachir - Improve `git-repl` prompt (#1224)
6f4cf0c johnpyp - feat: `delete-branch` multiple unique branch names completions (#1221)
...
215382b 罗泽轩 - Bump version to 7.5.0-dev (#1207)
</code></pre>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Tj Holowaychuk &lt;<a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#x3a;&#116;&#x6a;&#x40;&#x76;&#105;&#x73;&#x69;&#x6f;&#110;&#45;&#109;&#x65;&#x64;&#105;&#x61;&#x2e;&#99;&#97;" data-bare-link="true">&#x74;&#106;&#64;&#x76;&#x69;&#115;&#105;&#111;&#x6e;&#x2d;&#x6d;&#x65;&#x64;&#x69;&#97;&#46;&#x63;&#97;</a>&gt;</p>
<p>Written by Tj Holowaychuk &lt;<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
@ -123,10 +139,9 @@ TJ Holowaychuk - Merge pull request #129 from nickl-/develop
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>October 2017</li>
<li class='tc'>January 2026</li>
<li class='tr'>git-commits-since(1)</li>
</ol>

View file

@ -3,40 +3,46 @@ git-commits-since(1) -- Show commit logs since some date
## SYNOPSIS
`git-commits-since` [&lt;date&gt;]
`git-commits-since` [-r|--ref &lt;ref&gt;] [&lt;date&gt;]
## DESCRIPTION
List of commits since the given _date_.
List of commits since the given _date_ or _ref_.
## OPTIONS
&lt;date&gt;
Show commits more recent than <date>. By default, the command shows the commit logs since "last week".
Show commits more recent than &lt;date&gt;. By default, the command shows the commit logs since "last week".
-r, --ref &lt;ref&gt;
Show commits since the given ref (tag, branch, or commit). When specified, the command uses `ref..HEAD` instead of date-based filtering.
## EXAMPLES
It is really flexible and these are only 3 of the options, go ahead give it a try:
$ git commits-since yesterday
... commits since yesterday
nickl- - Merge branch upstream master.
nickl- - Rebase bolshakov with master
TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
TJ Holowaychuk - Merge pull request #129 from nickl-/develop
nickl- - Fix #127 git-ignore won't add duplicates.
aa084d9 TweeKane - Add global gitignore to git-ignore output
515e94a TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
5f86b54 TJ Holowaychuk - Merge pull request #129 from nickl-/develop
7398d10 nickl- - Fix #127 git-ignore won't add duplicates.
$ git commits-since 3 o clock pm
... commits since 3 o clock pm
nickl- - Merge branch upstream master.
aa084d9 TweeKane - Add global gitignore to git-ignore output
$ git commits-since 2 hour ago
... commits since 2 hour ago
nickl- - Merge branch upstream master.
TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
TJ Holowaychuk - Merge pull request #129 from nickl-/develop
aa084d9 TweeKane - Add global gitignore to git-ignore output
515e94a TJ Holowaychuk - Merge pull request #128 from nickl-/git-extras-html-hyperlinks
5f86b54 TJ Holowaychuk - Merge pull request #129 from nickl-/develop
$ git commits-since --ref 7.4.0
6ed2643 John Bachir - ability to specify command when hitting enter (#1223)
b9bd309 John Bachir - Improve `git-repl` prompt (#1224)
6f4cf0c johnpyp - feat: `delete-branch` multiple unique branch names completions (#1221)
...
215382b 罗泽轩 - Bump version to 7.5.0-dev (#1207)
## AUTHOR

19
man/git-continue.1 Normal file
View file

@ -0,0 +1,19 @@
.\" generated with Ronn-NG/v0.8.0
.\" http://github.com/apjanke/ronn-ng/tree/0.8.0
.TH "GIT\-CONTINUE" "1" "November 2024" "" "Git Extras"
.SH "NAME"
\fBgit\-continue\fR \- Continue current git operation
.SH "SYNOPSIS"
\fBgit\-continue\fR
.SH "DESCRIPTION"
Continue current git revert, rebase, merge or cherry\-pick process\.
.SH "OPTIONS"
There are no options, it just continues current operation\.
.SH "EXAMPLES"
\fBgit\-continue\fR
.SH "AUTHOR"
Written by oikarinen
.SH "REPORTING BUGS"
<\fI\%https://github\.com/tj/git\-extras/issues\fR>
.SH "SEE ALSO"
<\fI\%https://github\.com/tj/git\-extras\fR>

114
man/git-continue.html Normal file
View file

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' content='text/html;charset=utf8'>
<meta name='generator' content='Ronn-NG/v0.8.0 (http://github.com/apjanke/ronn-ng/tree/0.8.0)'>
<title>git-continue(1) - Continue current git operation</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
.mp h2 {margin:10px 0 0 0}
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
.mp h3 {margin:0 0 0 4ex}
.mp dt {margin:0;clear:left}
.mp dt.flush {float:left;width:8ex}
.mp dd {margin:0 0 0 9ex}
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
.mp pre {margin-bottom:20px}
.mp pre+h2,.mp pre+h3 {margin-top:22px}
.mp h2+pre,.mp h3+pre {margin-top:5px}
.mp img {display:block;margin:auto}
.mp h1.man-title {display:none}
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
.mp h2 {font-size:16px;line-height:1.25}
.mp h1 {font-size:20px;line-height:2}
.mp {text-align:justify;background:#fff}
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
.mp u {text-decoration:underline}
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
.mp b.man-ref {font-weight:normal;color:#434241}
.mp pre {padding:0 4ex}
.mp pre code {font-weight:normal;color:#434241}
.mp h2+pre,h3+pre {padding-left:0}
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
ol.man-decor {width:100%}
ol.man-decor li.tl {text-align:left}
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
ol.man-decor li.tr {text-align:right;float:right}
</style>
</head>
<!--
The following styles are deprecated and will be removed at some point:
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
.man-navigation should be used instead.
-->
<body id='manpage'>
<div class='mp' id='man'>
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#EXAMPLES">EXAMPLES</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#REPORTING-BUGS">REPORTING BUGS</a>
<a href="#SEE-ALSO">SEE ALSO</a>
</div>
<ol class='man-decor man-head man head'>
<li class='tl'>git-continue(1)</li>
<li class='tc'>Git Extras</li>
<li class='tr'>git-continue(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-continue</code> - <span class="man-whatis">Continue current git operation</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-continue</code></p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p> Continue current git revert, rebase, merge or cherry-pick process.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p> There are no options, it just continues current operation.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<p> <code>git-continue</code></p>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by oikarinen</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
<p>&lt;<a href="https://github.com/tj/git-extras/issues" data-bare-link="true">https://github.com/tj/git-extras/issues</a>&gt;</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>November 2024</li>
<li class='tr'>git-continue(1)</li>
</ol>
</div>
</body>
</html>

30
man/git-continue.md Normal file
View file

@ -0,0 +1,30 @@
git-continue(1) -- Continue current git operation
================================
## SYNOPSIS
`git-continue`
## DESCRIPTION
Continue current git revert, rebase, merge or cherry-pick process.
## OPTIONS
There are no options, it just continues current operation.
## EXAMPLES
`git-continue`
## AUTHOR
Written by oikarinen
## REPORTING BUGS
&lt;<https://github.com/tj/git-extras/issues>&gt;
## SEE ALSO
&lt;<https://github.com/tj/git-extras>&gt;

View file

@ -0,0 +1,54 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-DELETE\-GONE\-BRANCHES" "1" "March 2026" "" "Git Extras"
.
.SH "NAME"
\fBgit\-delete\-gone\-branches\fR \- Delete branches whose remote is gone
.
.SH "SYNOPSIS"
\fBgit\-delete\-gone\-branches\fR [\-n|\-\-dry\-run] [\-f|\-\-force] [\-p|\-\-prune]
.
.SH "DESCRIPTION"
Deletes all local branches whose remote\-tracking branch has been deleted\. This commonly happens after a pull request is merged and the remote branch is removed\. By default, lists the branches and prompts for confirmation before deleting\.
.
.SH "OPTIONS"
\-n, \-\-dry\-run
.
.P
Show the branches that would be deleted without actually deleting them\.
.
.P
\-f, \-\-force
.
.P
Skip the confirmation prompt and delete branches immediately\.
.
.P
\-p, \-\-prune
.
.P
Run \fBgit fetch \-\-prune\fR before checking for gone branches, to ensure remote\-tracking refs are up to date\.
.
.SH "EXAMPLES"
.
.nf
$ git delete\-gone\-branches
$ git delete\-gone\-branches \-\-dry\-run
$ git delete\-gone\-branches \-\-force
$ git delete\-gone\-branches \-\-prune
.
.fi
.
.SH "AUTHOR"
Written by Utsav Sabharwal <\fIhttps://github\.com/codersofthedark\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

View file

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>git-delete-gone-branches(1) - Delete branches whose remote is gone</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
.mp h2 {margin:10px 0 0 0}
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
.mp h3 {margin:0 0 0 4ex}
.mp dt {margin:0;clear:left}
.mp dt.flush {float:left;width:8ex}
.mp dd {margin:0 0 0 9ex}
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
.mp pre {margin-bottom:20px}
.mp pre+h2,.mp pre+h3 {margin-top:22px}
.mp h2+pre,.mp h3+pre {margin-top:5px}
.mp img {display:block;margin:auto}
.mp h1.man-title {display:none}
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
.mp h2 {font-size:16px;line-height:1.25}
.mp h1 {font-size:20px;line-height:2}
.mp {text-align:justify;background:#fff}
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
.mp u {text-decoration:underline}
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
.mp b.man-ref {font-weight:normal;color:#434241}
.mp pre {padding:0 4ex}
.mp pre code {font-weight:normal;color:#434241}
.mp h2+pre,h3+pre {padding-left:0}
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
ol.man-decor {width:100%}
ol.man-decor li.tl {text-align:left}
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
ol.man-decor li.tr {text-align:right;float:right}
</style>
</head>
<!--
The following styles are deprecated and will be removed at some point:
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
.man-navigation should be used instead.
-->
<body id='manpage'>
<div class='mp' id='man'>
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#EXAMPLES">EXAMPLES</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#REPORTING-BUGS">REPORTING BUGS</a>
<a href="#SEE-ALSO">SEE ALSO</a>
</div>
<ol class='man-decor man-head man head'>
<li class='tl'>git-delete-gone-branches(1)</li>
<li class='tc'>Git Extras</li>
<li class='tr'>git-delete-gone-branches(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-delete-gone-branches</code> - <span class="man-whatis">Delete branches whose remote is gone</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-delete-gone-branches</code> [-n|--dry-run] [-f|--force] [-p|--prune]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p> Deletes all local branches whose remote-tracking branch has been deleted.
This commonly happens after a pull request is merged and the remote branch
is removed. By default, lists the branches and prompts for confirmation
before deleting.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p> -n, --dry-run</p>
<p> Show the branches that would be deleted without actually deleting them.</p>
<p> -f, --force</p>
<p> Skip the confirmation prompt and delete branches immediately.</p>
<p> -p, --prune</p>
<p> Run <code>git fetch --prune</code> before checking for gone branches, to ensure
remote-tracking refs are up to date.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<pre><code>$ git delete-gone-branches
$ git delete-gone-branches --dry-run
$ git delete-gone-branches --force
$ git delete-gone-branches --prune
</code></pre>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Utsav Sabharwal &lt;<a href="&#x6d;&#97;&#105;&#x6c;&#x74;&#111;&#x3a;&#117;&#116;&#115;&#97;&#x76;&#x2e;&#115;&#x61;&#x62;&#x68;&#x61;&#x72;&#x77;&#x61;&#108;&#64;&#115;&#x79;&#x73;&#x64;&#105;&#x67;&#x2e;&#99;&#111;&#x6d;" data-bare-link="true">&#117;&#116;&#115;&#x61;&#x76;&#x2e;&#x73;&#x61;&#x62;&#104;&#97;&#x72;&#x77;&#97;&#108;&#64;&#x73;&#121;&#115;&#x64;&#105;&#103;&#46;&#x63;&#x6f;&#109;</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
<p>&lt;<a href="https://github.com/tj/git-extras/issues" data-bare-link="true">https://github.com/tj/git-extras/issues</a>&gt;</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>March 2026</li>
<li class='tr'>git-delete-gone-branches(1)</li>
</ol>
</div>
</body>
</html>

View file

@ -0,0 +1,50 @@
git-delete-gone-branches(1) -- Delete branches whose remote is gone
====================================================================
## SYNOPSIS
`git-delete-gone-branches` [-n|--dry-run] [-f|--force] [-p|--prune]
## DESCRIPTION
Deletes all local branches whose remote-tracking branch has been deleted.
This commonly happens after a pull request is merged and the remote branch
is removed. By default, lists the branches and prompts for confirmation
before deleting.
## OPTIONS
-n, --dry-run
Show the branches that would be deleted without actually deleting them.
-f, --force
Skip the confirmation prompt and delete branches immediately.
-p, --prune
Run `git fetch --prune` before checking for gone branches, to ensure
remote-tracking refs are up to date.
## EXAMPLES
$ git delete-gone-branches
$ git delete-gone-branches --dry-run
$ git delete-gone-branches --force
$ git delete-gone-branches --prune
## AUTHOR
Written by Utsav Sabharwal &lt;<https://github.com/codersofthedark>&gt;
## REPORTING BUGS
&lt;<https://github.com/tj/git-extras/issues>&gt;
## SEE ALSO
&lt;<https://github.com/tj/git-extras>&gt;

View file

@ -1,30 +1,19 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-DELETE\-MERGED\-BRANCHES" "1" "October 2017" "" "Git Extras"
.
.\" generated with Ronn-NG/v0.10.1
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "GIT\-DELETE\-MERGED\-BRANCHES" "1" "March 2026" "" "Git Extras"
.SH "NAME"
\fBgit\-delete\-merged\-branches\fR \- Delete merged branches
.
.SH "SYNOPSIS"
\fBgit\-delete\-merged\-branches\fR
.
.SH "DESCRIPTION"
Deletes all branches merged in to current HEAD\. Does not delete \fImaster\fR, even if run from a branch that is a descendant of \fImaster\fR\.
.
Deletes all branches merged in to current HEAD\. Does not delete the default branch, even if run from a branch that is a descendant of it\.
.SH "EXAMPLES"
.
.nf
$ git delete\-merged\-branches
.
.fi
.
.SH "AUTHOR"
Written by Jesús Espino <\fIjespinog@gmail\.com\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>

View file

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<meta http-equiv='content-type' content='text/html;charset=utf-8'>
<meta name='generator' content='Ronn-NG/v0.10.1 (http://github.com/apjanke/ronn-ng/tree/0.10.1)'>
<title>git-delete-merged-branches(1) - Delete merged branches</title>
<style type='text/css' media='all'>
/* style: man */
@ -68,19 +68,20 @@
<li class='tr'>git-delete-merged-branches(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-delete-merged-branches</code> - <span class="man-whatis">Delete merged branches</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-delete-merged-branches</code></p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p> Deletes all branches merged in to current HEAD. Does not delete <em>master</em>, even if run from a branch that is
a descendant of <em>master</em>.</p>
<p>Deletes all branches merged in to current HEAD. Does not delete the default branch, even if run from a branch that is
a descendant of it.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
@ -89,7 +90,7 @@
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Jesús Espino &lt;<a href="&#x6d;&#97;&#105;&#108;&#116;&#111;&#58;&#106;&#x65;&#x73;&#x70;&#105;&#110;&#111;&#x67;&#64;&#x67;&#x6d;&#x61;&#x69;&#108;&#x2e;&#x63;&#111;&#109;" data-bare-link="true">&#x6a;&#x65;&#115;&#112;&#105;&#110;&#x6f;&#x67;&#64;&#x67;&#x6d;&#97;&#x69;&#x6c;&#x2e;&#x63;&#111;&#109;</a>&gt;</p>
<p>Written by Jesús Espino &lt;<a href="mailto:jespinog@gmail.com" data-bare-link="true">jespinog@gmail.com</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
@ -99,10 +100,9 @@
<p>&lt;<a href="https://github.com/tj/git-extras" data-bare-link="true">https://github.com/tj/git-extras</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>October 2017</li>
<li class='tc'>March 2026</li>
<li class='tr'>git-delete-merged-branches(1)</li>
</ol>

View file

@ -7,8 +7,8 @@ git-delete-merged-branches(1) -- Delete merged branches
## DESCRIPTION
Deletes all branches merged in to current HEAD. Does not delete *master*, even if run from a branch that is
a descendant of *master*.
Deletes all branches merged in to current HEAD. Does not delete the default branch, even if run from a branch that is
a descendant of it.
## EXAMPLES

View file

@ -1,18 +1,24 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-DELETE\-SQUASHED\-BRANCHES" "1" "May 2021" "" "Git Extras"
.TH "GIT\-DELETE\-SQUASHED\-BRANCHES" "1" "February 2024" "" "Git Extras"
.
.SH "NAME"
\fBgit\-delete\-squashed\-branches\fR \- Delete branches that were squashed
.
.SH "SYNOPSIS"
\fBgit\-delete\-squashed\-branches\fR [<branch\-name>]
\fBgit\-delete\-squashed\-branches\fR [\-\-proceed, \-p] [<branch\-name>]
.
.SH "DESCRIPTION"
Deletes all git branches that have been "squash\-merged" into \fBbranch\-name\fR\.
.
.SH "OPTIONS"
\-\-proceed, \-p
.
.P
Proceed with the next branch even if the current branch cannot be deleted (e\.g\. because it is checked out in a worktree)
.
.P
<branch\-name>
.
.P

View file

@ -76,7 +76,7 @@
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-delete-squashed-branches</code> [&lt;branch-name&gt;]</p>
<p><code>git-delete-squashed-branches</code> [--proceed, -p] [&lt;branch-name&gt;]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@ -84,6 +84,10 @@
<h2 id="OPTIONS">OPTIONS</h2>
<p> --proceed, -p</p>
<p> Proceed with the next branch even if the current branch cannot be deleted (e.g. because it is checked out in a worktree)</p>
<p> &lt;branch-name&gt;</p>
<p> The target branch were the "squashed-merged" branches were committed to. If no value is given, then the current checked out branch will be used.</p>
@ -102,7 +106,7 @@
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Teddy Katz &lt;<a href="&#109;&#97;&#x69;&#108;&#x74;&#x6f;&#58;&#116;&#x65;&#x64;&#x64;&#121;&#46;&#x6b;&#97;&#116;&#122;&#64;&#103;&#109;&#x61;&#105;&#108;&#46;&#99;&#x6f;&#x6d;" data-bare-link="true">&#x74;&#101;&#x64;&#100;&#x79;&#46;&#x6b;&#x61;&#x74;&#x7a;&#x40;&#x67;&#109;&#97;&#105;&#108;&#46;&#x63;&#111;&#109;</a>&gt; and Vladimir Jimenez &lt;<a href="&#x6d;&#97;&#x69;&#108;&#116;&#x6f;&#58;&#109;&#x65;&#x40;&#97;&#108;&#x6c;&#x65;&#x6a;&#111;&#x2e;&#105;&#x6f;" data-bare-link="true">&#109;&#x65;&#64;&#x61;&#x6c;&#108;&#x65;&#106;&#x6f;&#46;&#105;&#x6f;</a>&gt;</p>
<p>Written by Teddy Katz &lt;<a href="&#109;&#97;&#105;&#108;&#x74;&#111;&#58;&#116;&#101;&#100;&#x64;&#x79;&#46;&#x6b;&#97;&#x74;&#122;&#64;&#103;&#109;&#97;&#x69;&#108;&#46;&#99;&#x6f;&#x6d;" data-bare-link="true">&#116;&#x65;&#x64;&#x64;&#x79;&#x2e;&#x6b;&#97;&#116;&#122;&#64;&#103;&#109;&#x61;&#105;&#x6c;&#x2e;&#x63;&#x6f;&#109;</a>&gt; and Vladimir Jimenez &lt;<a href="&#x6d;&#x61;&#105;&#x6c;&#x74;&#x6f;&#58;&#x6d;&#x65;&#x40;&#x61;&#x6c;&#108;&#101;&#106;&#111;&#46;&#105;&#111;" data-bare-link="true">&#109;&#101;&#64;&#x61;&#108;&#x6c;&#x65;&#106;&#111;&#46;&#x69;&#111;</a>&gt;</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
@ -115,7 +119,7 @@
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>May 2021</li>
<li class='tc'>February 2024</li>
<li class='tr'>git-delete-squashed-branches(1)</li>
</ol>

Some files were not shown because too many files have changed in this diff Show more