Git to Sapling CLI shim
Project description
gitsl
Git to Sapling CLI shim - translates git commands to their Sapling (sl) equivalents.
Installation
pip install gitsl
Requires Python 3.8 or later. Requires Sapling to be installed and available as sl.
Quick Start
Use familiar git commands in any Sapling repository:
# Check status (outputs git-compatible format)
gitsl status --porcelain
# View recent commits
gitsl log --oneline -5
# Stage and commit changes
gitsl add -A
gitsl commit -m "Your message"
gitsl translates these to equivalent Sapling commands automatically.
Supported Commands
| Command | Status | Translation |
|---|---|---|
init |
Full | sl init |
status |
Full | sl status with output transformation |
log |
Full | sl log with flag translation |
diff |
Full | sl diff |
add |
Full | sl add / sl addremove |
commit |
Full | sl commit |
rev-parse |
Partial | Only --short HEAD via sl whereami |
Commands not listed are unsupported.
Command Reference
git status
| Flag | Supported | Behavior |
|---|---|---|
| (none) | Yes | Passthrough to sl status |
--porcelain |
Yes | Output transformed to git XY format |
--short / -s |
Yes | Output transformed to git XY format |
| other flags | Partial | Passed through to sl |
Status code translation:
| Sapling | Git | Meaning |
|---|---|---|
M |
M |
Modified in working tree |
A |
A |
Added (staged) |
R |
D |
Removed (staged deletion) |
? |
?? |
Untracked |
! |
D |
Missing (deleted from disk) |
git log
| Flag | Supported | Translation |
|---|---|---|
| (none) | Yes | sl log |
--oneline |
Yes | sl log -T "{node|short} {desc|firstline}\n" |
-N (e.g., -5) |
Yes | sl log -l N |
-n N |
Yes | sl log -l N |
-nN |
Yes | sl log -l N |
--max-count=N |
Yes | sl log -l N |
--format |
No | Not implemented |
--graph |
No | Not implemented |
git add
| Flag | Supported | Translation |
|---|---|---|
<files> |
Yes | sl add <files> |
-A / --all |
Yes | sl addremove |
-u / --update |
Yes | Marks deleted files with sl remove --mark |
-p / --patch |
No | Not implemented |
git diff, git init, git commit
All flags passed through to sl equivalents unchanged.
git rev-parse
| Flag | Supported | Translation |
|---|---|---|
--short HEAD |
Yes | sl whereami (truncated to 7 chars) |
| other variants | No | Returns error |
Unsupported Commands
Commands not listed above will print a message to stderr and exit with code 0:
gitsl: unsupported command: git checkout main
This exit behavior prevents gitsl from breaking tools that expect git commands to succeed.
For unsupported operations, use Sapling commands directly. See the Sapling Git Cheat Sheet for translations.
Why Some Commands Are Unsupported
| Command | Reason |
|---|---|
checkout |
Sapling uses goto with different semantics |
branch |
Sapling uses bookmarks, different model |
merge |
Sapling prefers rebase workflow |
rebase |
Complex flag translation, use sl rebase directly |
stash |
Use sl shelve / sl unshelve directly |
push / pull / fetch |
Remote operations differ significantly |
Debug Mode
Set GITSL_DEBUG=1 to see what command would be executed without running it:
$ GITSL_DEBUG=1 gitsl status --porcelain
[DEBUG] Command: status
[DEBUG] Args: ['--porcelain']
[DEBUG] Would execute: sl status
How It Works
gitsl intercepts git commands and translates them to Sapling equivalents:
- Parses the git command and flags
- Translates to corresponding sl command
- Transforms output to git-compatible format where needed (status, log)
- Returns sl's exit code
For commands without translation, gitsl prints a message to stderr and exits 0.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitsl-1.1.tar.gz.
File metadata
- Download URL: gitsl-1.1.tar.gz
- Upload date:
- Size: 209.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d59845f7a0dc215bc53c675217e71b1a90d1554cbc9fb75a350c0c5c1c9ac31
|
|
| MD5 |
427a1267ccd1397c49fb8846773ddec8
|
|
| BLAKE2b-256 |
9953dfbc5e4ca223503c536b2cd81af568476830fde373ebbfe70692dd360bbe
|
Provenance
The following attestation bundles were made for gitsl-1.1.tar.gz:
Publisher:
release.yml on VladimirMakaev/gitsl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitsl-1.1.tar.gz -
Subject digest:
3d59845f7a0dc215bc53c675217e71b1a90d1554cbc9fb75a350c0c5c1c9ac31 - Sigstore transparency entry: 835219532
- Sigstore integration time:
-
Permalink:
VladimirMakaev/gitsl@c4ae759a00c119bdf4a95593769bf5b9b4ca472a -
Branch / Tag:
refs/tags/v1.1 - Owner: https://github.com/VladimirMakaev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4ae759a00c119bdf4a95593769bf5b9b4ca472a -
Trigger Event:
push
-
Statement type:
File details
Details for the file gitsl-1.1-py3-none-any.whl.
File metadata
- Download URL: gitsl-1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2da140599a19207fd0b6b00566193e9f9cc392a4dff57ebe4595c4a4bb2e8792
|
|
| MD5 |
81dbd7c408ba54768be4183617cb83a6
|
|
| BLAKE2b-256 |
1a9c78288f803a3234c679ce29566f85c8dfaa6c727a4b48b748fd4116a61a48
|
Provenance
The following attestation bundles were made for gitsl-1.1-py3-none-any.whl:
Publisher:
release.yml on VladimirMakaev/gitsl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitsl-1.1-py3-none-any.whl -
Subject digest:
2da140599a19207fd0b6b00566193e9f9cc392a4dff57ebe4595c4a4bb2e8792 - Sigstore transparency entry: 835219572
- Sigstore integration time:
-
Permalink:
VladimirMakaev/gitsl@c4ae759a00c119bdf4a95593769bf5b9b4ca472a -
Branch / Tag:
refs/tags/v1.1 - Owner: https://github.com/VladimirMakaev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4ae759a00c119bdf4a95593769bf5b9b4ca472a -
Trigger Event:
push
-
Statement type: