Skip to content

Feature: Add rebasing and cherryPicking state to status - #HSFDPMUW - #1184

Open
AhmedouNdeddou wants to merge 10 commits into
steveukx:mainfrom
AhmedouNdeddou:feature/status-rebase-cherrypick-1029
Open

Feature: Add rebasing and cherryPicking state to status - #HSFDPMUW#1184
AhmedouNdeddou wants to merge 10 commits into
steveukx:mainfrom
AhmedouNdeddou:feature/status-rebase-cherrypick-1029

Conversation

@AhmedouNdeddou

Copy link
Copy Markdown

Description

This change adds rebasing and cherry-picking state information to the status result.

What was done

  • Added rebasing boolean flag to StatusResult
  • Added cherryPicking boolean flag to StatusResult
  • Parses git status output for both states using regex patterns
  • Updated StatusSummary class with new properties

Example

const status = await git.status();
if (status.rebasing) {
   console.log('Rebase in progress');
}
if (status.cherryPicking) {
   console.log('Cherry-pick in progress');
}

AhmedouNdeddou and others added 10 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
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9414e97

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