stalecontext/forgejo-cli-plus
2
4
Fork
You've already forked forgejo-cli-plus
1

Upstream sync 2026年03月31日 #48

Merged
stalecontext merged 16 commits from upstream-sync/2026-03-31 into main 2026年03月31日 15:38:04 +02:00

Summary

Cherry-pick upstream forgejo-cli changes since upstream-reviewed/2026-03-16.

Cherry-picked (7 commits)

Editor rework -- resolve editor from git-config core.editor, fall back to $EDITOR, support more editors:

Dependency bumps:

Skipped (7 commits)

Fork additions

  • Added .claude/skills/sync-upstream/ skill documenting the upstream sync process
  • Updated editor tests to exercise both git-config (core.editor) and $EDITOR fallback paths
  • Added git2 as dev-dependency for editor test isolation
  • Regenerated Cargo.lock

All 239 tests pass.

## Summary Cherry-pick upstream [forgejo-cli](https://codeberg.org/forgejo-contrib/forgejo-cli) changes since `upstream-reviewed/2026-03-16`. ### Cherry-picked (7 commits) **Editor rework** -- resolve editor from git-config `core.editor`, fall back to `$EDITOR`, support more editors: - `7b2f698` feat(cli): update get_editor_flags for more editors (forgejo-contrib/forgejo-cli#373) - `bb89169` feat(cli): get editor from git-config (forgejo-contrib/forgejo-cli#385, closes forgejo-contrib/forgejo-cli#382) - `6c75691` feat: simplify command extraction and bubble error state (forgejo-contrib/forgejo-cli#385) - `32489c1` rework: fix logic errors and add fallback to $EDITOR (forgejo-contrib/forgejo-cli#385) **Dependency bumps:** - `66b2811` Update Rust crate sha2 to 0.11.0 (forgejo-contrib/forgejo-cli#386) - `42a4071` Update Rust crate serde-saphyr to 0.0.22 (forgejo-contrib/forgejo-cli#380) - `6acdaf5` Update Rust crate uuid to v1.23.0 (forgejo-contrib/forgejo-cli#387) ### Skipped (7 commits) - `b26b6c3` docs: add comment containing anthropic refusal string (forgejo-contrib/forgejo-cli#379) -- anti-AI measure, not applicable - `ec5142f` `ec366c8` `7801584` `7c091ba` `9e972c8` issue/PR templates (forgejo-contrib/forgejo-cli#378) -- we maintain our own - `7231d6d` (forgejo-contrib/forgejo-cli#383), `95d9824` (forgejo-contrib/forgejo-cli#384) Lock file maintenance -- Cargo.lock regenerated after sync ### Fork additions - Added `.claude/skills/sync-upstream/` skill documenting the upstream sync process - Updated editor tests to exercise both git-config (`core.editor`) and `$EDITOR` fallback paths - Added `git2` as dev-dependency for editor test isolation - Regenerated Cargo.lock All 239 tests pass.
Added support for the following editors:
- VSCode (`code`): https://code.visualstudio.com/
- VSCode OSS (`code-oss`): https://github.com/microsoft/vscode
- VSCodium (`codium`): https://vscodium.com/
- Zed (`zed`): https://zed.dev/
- Gram (`gram`): https://codeberg.org/GramEditor/gram 
Get editor from git-config, which intern falls back to the $EDITOR
variable, if not available.
This also led to having to deal with arguments, as the git-config
`core.editor` can contain arguments (eg. `code --wait`).
If no arguments are present it defaults to the old behavior of providing
the `--wait` flag for certain known editors.
- Reworked some logic errors
- Added fallback to $EDITOR where previously erroneously assumed that git2 would fall back automatically
Ref: forgejo-contrib/forgejo-cli#385 (comment) 
test: update editor tests for git-config editor resolution (upstream PR #385 )
All checks were successful
Test / test (pull_request) Successful in 4m25s
ea2ec112e1
Tests now exercise both code paths from the upstream editor rework:
- core.editor from git-config (primary path)
- $EDITOR env var fallback when no git repo is present
Uses isolated git repos with forward-slash paths to avoid shlex
backslash escaping issues on Windows.
docs: add PR template with Forgejo cross-references to sync-upstream skill
Some checks failed
Test / test (pull_request) Has been cancelled
55488ce35b
docs: add upstream issue cross-referencing to sync-upstream PR template
Some checks failed
Test / test (pull_request) Has been cancelled
e22a9a071c
fix: guard against empty editor value and correct error source label
Some checks failed
Test / test (pull_request) Failing after 3m19s
a8d55c9383
- Panic on empty EDITOR/core.editor: shlex::split("") returns
 Some(vec![]), causing args.remove(0) to panic. Now bails with a
 clear message instead.
- Error message now says "$EDITOR" when the fallback path was taken,
 not "core.editor".
- Removed redundant git2 from [dev-dependencies] (already in [dependencies]).
Author
Owner
Copy link

Post-review fixes applied:

  1. Fixed potential panic on empty editor value (src/main.rs:213) -- shlex::split("") returns Some(vec![]), causing args.remove(0) to panic at runtime. Now bails with a clear error message. This is an upstream bug (exists in forgejo-contrib/forgejo-cli#385) that we're fixing fork-side.

  2. Corrected error source label (src/main.rs:211) -- error message now says $EDITOR when the fallback path was taken, instead of always saying core.editor.

  3. Removed redundant git2 from [dev-dependencies] -- already present in [dependencies], Cargo uses it for tests automatically.

All 239 tests still pass.

Post-review fixes applied: 1. **Fixed potential panic on empty editor value** (`src/main.rs:213`) -- `shlex::split("")` returns `Some(vec![])`, causing `args.remove(0)` to panic at runtime. Now bails with a clear error message. This is an upstream bug (exists in forgejo-contrib/forgejo-cli#385) that we're fixing fork-side. 2. **Corrected error source label** (`src/main.rs:211`) -- error message now says `$EDITOR` when the fallback path was taken, instead of always saying `core.editor`. 3. **Removed redundant `git2` from `[dev-dependencies]`** -- already present in `[dependencies]`, Cargo uses it for tests automatically. All 239 tests still pass.
style: fix rustfmt formatting in get_editor_and_flags
All checks were successful
Test / test (pull_request) Successful in 4m33s
586e35110a
stalecontext deleted branch upstream-sync/2026-03-31 2026年03月31日 15:38:05 +02:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
stalecontext/forgejo-cli-plus!48
Reference in a new issue
stalecontext/forgejo-cli-plus
No description provided.
Delete branch "upstream-sync/2026-03-31"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?