Skip to content

Feature: Add signature parsing to raw() for --show-signature - #HSFDPMUW - #1185

Open
AhmedouNdeddou wants to merge 11 commits into
steveukx:mainfrom
AhmedouNdeddou:feature/signature-raw-990
Open

Feature: Add signature parsing to raw() for --show-signature - #HSFDPMUW#1185
AhmedouNdeddou wants to merge 11 commits into
steveukx:mainfrom
AhmedouNdeddou:feature/signature-raw-990

Conversation

@AhmedouNdeddou

Copy link
Copy Markdown

Description

This change adds signature information parsing when using git.raw(['--show-signature', ...]).

What was done

  • Added SignatureInfo interface
  • Added RawResult interface
  • Parses GPG signature status (GOOD/BAD/ERROR/NONE)
  • Extracts signer name and email
  • Extracts key ID and timestamp
  • Returns structured signature info in raw() response

Example

const result = await git.raw(['--show-signature', 'commit-hash']);
console.log(result.signature);
// {
//   verified: true,
//   status: 'GOOD',
//   signer: 'John Doe <john@example.com>',
//   keyId: '1234567890ABCDEF',
//   timestamp: 'Mon Jul 20 2026 12:00:00 UTC'
// }

AhmedouNdeddou and others added 11 commits July 21, 2025 18:55
###  Inhalt
Dieser Pull Request ergänzt einen Unit-Test, der die Funktionen `.add()` und `.commit()` von `simple-git` testet.

###  Details
- Erstellt temporär ein Repository in einem neuen Ordner
- Legt eine Datei `test.txt` an
- Führt `.add()` und `.commit()` durch
- Überprüft per `.log()`, ob der Commit erfolgreich war

###  Erwartung
- Git-Log enthält mindestens einen Commit
- Letzter Commit hat die Nachricht: `Add test.txt`

###  Warum ist das wichtig?
- Testet zwei der wichtigsten Basisfunktionen von `simple-git`
- Stellt sicher, dass das `add + commit`-Verhalten korrekt funktioniert
- Erhöht die Testabdeckung und stärkt das Vertrauen in die API

###  Kontext
Dieser Beitrag erfolgt im Rahmen des Hochschulprojekts **#HSFDPMUW** – Modul: Programmiermethoden & Werkzeuge.
Test: add and commit a file using simple-git #HSFDPMUW
###  Inhalt
Dieser Pull Request enthält einen Unit-Test für die Methode `.checkoutLocalBranch()` von `simple-git`.

###  Details
- Erstellt ein temporäres Git-Repository
- Macht einen leeren Initial-Commit (`--allow-empty`)
- Erstellt und wechselt zu einem neuen Branch `feature-branch` mit `.checkoutLocalBranch()`
- Prüft, ob der aktuelle Branch korrekt gesetzt wurde

###  Erwartung
- Aktueller Branch ist `feature-branch`

###  Warum ist das nützlich?
- Testet typisches Branch-Management-Verhalten
- Verifiziert, dass `.checkoutLocalBranch()` wie dokumentiert funktioniert
- Trägt zur Testabdeckung und zur Robustheit der API bei

### Kontext
Dieser Beitrag erfolgt im Rahmen des Hochschulprojekts **#HSFDPMUW** – Modul: Programmiermethoden & Werkzeuge.
Test: checkoutLocalBranch should switch to new branch #HSFDPMUW
###  Inhalt
Dieser Pull Request fügt einen Unit-Test für die Methode `.log()` von `simple-git` hinzu.

###  Details
- Erstellt ein temporäres Git-Repository
- Fügt zwei Dateien nacheinander hinzu (`file1.txt`, `file2.txt`)
- Führt jeweils einen Commit durch
- Ruft `.log()` auf und überprüft die Historie

###  Erwartung
- Git-Log gibt zwei Commits zurück
- Beide Commit-Messages sind enthalten (`first commit`, `second commit`)

###  Warum ist das nützlich?
- Testet ein zentrales Feature: die Historie der Commits
- Verifiziert das Verhalten von `.log()` mit mehreren Einträgen
- Unterstützt die langfristige Stabilität der API

### Kontext
Dieser Beitrag erfolgt im Rahmen des Hochschulprojekts **#HSFDPMUW** – Modul: Programmiermethoden & Werkzeuge.
Test: log should return multiple commits from history #HSFDPMUW
Adds native parsing of Git trailers in commit objects:
- Adds 'trailers' property to CommitResult interface
- Adds parseTrailers function in parse-commit.ts
- Parses trailers from commit message body

This allows users to access structured trailer data like:
- Signed-off-by
- Reviewed-by
- Custom trailers

Closes steveukx#1046
Uses Node.js process.env as base for environment variables in git processes.

- Adds env option to SimpleGitOptions
- Merges process.env with custom env variables in GitExecutor
- Passes env through Git factory and Git class constructor
- Allows overriding specific environment variables

Closes steveukx#1017
Prevents zombie processes in Docker environments by:
- Using detached: true in spawn options for remote commands
- Calling child.unref() to detach from parent process
- Only affects remote commands (fetch, pull, push, clone, remote)

Closes steveukx#1062
Adds state information to StatusResult:
- 
ebasing: true when a rebase is in progress
- cherryPicking: true when a cherry-pick is in progress
- Parses from git status output

Closes steveukx#1029
Adds signature information parsing when using git.raw(['--show-signature', ...]):
- Added SignatureInfo interface
- Added RawResult interface
- Parses GPG signature status (GOOD/BAD/ERROR/NONE)
- Extracts signer name, email, key ID and timestamp

Closes steveukx#990
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2fccf39

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants