* 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>
* 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>
* 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
* 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}
```
* 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
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
* 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.
* 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
* 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
* 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