Skip to content

Running under PowerShell fails to invoke git in hooks #370

Open
@AaronLieberman

Description

@AaronLieberman

Description of the bug

Moving commit generates a warning and leaves the old commit in place.
I'm on Windows 11, in a PowerShell terminal.

⋮
◇ f148352 13d (remote origin/main) Fix up renamed csproj
┃
◯ 777ac1f 8s file1
┃
● 9c3f752 1s file2
D:\Projects\Git\ExpressionTree > git move -s HEAD -d f148352
Attempting rebase in-memory...
[1/1] Committed as: 62e3191 file2
/d/Projects/Git/ExpressionTree/.git/hooks/reference-transaction: line 6: git: command not found
branchless: Failed to process reference transaction!
branchless: Some events (e.g. branch updates) may have been lost.
branchless: This is a bug. Please report it.
/d/Projects/Git/ExpressionTree/.git/hooks/post-rewrite: line 4: git: command not found
branchless: running command: git checkout 62e3191f2ff4bae240bf82e4f9e2532b75b9b43a
Previous HEAD position was 9c3f752 file2
branchless: processing 1 update: ref HEAD
HEAD is now at 62e3191 file2
branchless: processing checkout
branchless: running command: git branchless smartlog
:
O f148352 13d (remote origin/main) Fix up renamed csproj
|\
| o 777ac1f 15s file1
| |
| o 9c3f752 8s file2
|
@ 62e3191 1s file2
In-memory rebase succeeded.

Expected behavior

I expected the HEAD commit to be moved to be a child of origin/main.

Actual behavior

  • Warning generated about not being able to find git.
  • Commit cherry-picked to the correct location but original commits are still visible.

Version of git-branchless

git-branchless 0.3.12

Version of git

git version 2.35.1.windows.2

Version of rustc

rustc 1.57.0 (f1edd0429 2021-11-29)

Automated bug report

Software version

git-branchless 0.3.12

Operating system

Windows 6.2.9200

Command-line

git-branchless bug-report 

Environment variables

SHELL=<not set>
EDITOR=<not set>

Git version

> git version 
git version 2.35.1.windows.2

Events

Show 5 events
Event ID: 151, transaction ID: 288
  1. RefUpdateEvent { timestamp: 1650762474.984679, event_tx_id: EventTransactionId(288), ref_name: "HEAD", old_oid: 0000000000000000000000000000000000000000, new_oid: 62e3191f2ff4bae240bf82e4f9e2532b75b9b43a, message: None }
  2. RefUpdateEvent { timestamp: 1650762475.0473373, event_tx_id: EventTransactionId(288), ref_name: "HEAD", old_oid: 9c3f7524633c5c38a57c47ec51d91b768557aa5a, new_oid: 62e3191f2ff4bae240bf82e4f9e2532b75b9b43a, message: None }
:
O f148352 13d (remote origin/main) xxx xx xxxxxxx xxxxxx
|\
| o 777ac1f 5m xxxxx
| |
| o 9c3f752 5m xxxxx
|
@ 62e3191 5m xxxxx
Event ID: 149, transaction ID: 286
  1. RefUpdateEvent { timestamp: 1650762467.3501792, event_tx_id: EventTransactionId(286), ref_name: "HEAD", old_oid: 777ac1f503f886aa09ea66499a7a993642b726ed, new_oid: 9c3f7524633c5c38a57c47ec51d91b768557aa5a, message: None }
  2. CommitEvent { timestamp: 1650762467.0, event_tx_id: EventTransactionId(286), commit_oid: NonZeroOid(9c3f7524633c5c38a57c47ec51d91b768557aa5a) }
:
O f148352 13d (remote origin/main) xxx xx xxxxxxx xxxxxx
|\
| o 777ac1f 5m xxxxx
| |
| o 9c3f752 5m xxxxx
|
@ 62e3191 5m xxxxx
Event ID: 147, transaction ID: 284
  1. RefUpdateEvent { timestamp: 1650762460.6356707, event_tx_id: EventTransactionId(284), ref_name: "HEAD", old_oid: f148352480d981f078b609f5a49870baa2e6d107, new_oid: 777ac1f503f886aa09ea66499a7a993642b726ed, message: None }
  2. CommitEvent { timestamp: 1650762460.0, event_tx_id: EventTransactionId(284), commit_oid: NonZeroOid(777ac1f503f886aa09ea66499a7a993642b726ed) }
:
O f148352 13d (remote origin/main) xxx xx xxxxxxx xxxxxx
|\
| o 777ac1f 5m xxxxx
| |
| o 9c3f752 5m xxxxx
|
@ 62e3191 5m xxxxx
Event ID: 145, transaction ID: 280
  1. RefUpdateEvent { timestamp: 1650762410.2934084, event_tx_id: EventTransactionId(280), ref_name: "HEAD", old_oid: 0000000000000000000000000000000000000000, new_oid: f148352480d981f078b609f5a49870baa2e6d107, message: None }
  2. RefUpdateEvent { timestamp: 1650762410.4033375, event_tx_id: EventTransactionId(280), ref_name: "HEAD", old_oid: a1d0e44057382e04c4c3b8c97e45476a531da573, new_oid: f148352480d981f078b609f5a49870baa2e6d107, message: None }
:
O f148352 13d (remote origin/main) xxx xx xxxxxxx xxxxxx
|\
| o 777ac1f 5m xxxxx
| |
| o 9c3f752 5m xxxxx
|
@ 62e3191 5m xxxxx
Event ID: 137, transaction ID: 278
  1. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(8d637802135c65b18ae4ee74b6e843ca9f65fcbd) }
  2. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(0917e2432c2088cad223936d1f083fcc4b01535a) }
  3. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(a2a2267cc32a5c6b0e78def64aff016235ae9c27) }
  4. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(1531d1efb28c142256b81d7ca17ff3e4c5147e78) }
  5. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(385c75dda30476f5301e083367a8eeecc36cd4ef) }
  6. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(2a4949f6cbaec426b020f8bb17dab807dcdac7d1) }
  7. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(618594b6577643ea1cece6d4a4ac0a0f59ea0e36) }
  8. ObsoleteEvent { timestamp: 1650762402.4933422, event_tx_id: EventTransactionId(278), commit_oid: NonZeroOid(a1d0e44057382e04c4c3b8c97e45476a531da573) }
:
O f148352 13d (remote origin/main) xxx xx xxxxxxx xxxxxx
|\
| o 777ac1f 5m xxxxx
| |
| o 9c3f752 5m xxxxx
|
@ 62e3191 5m xxxxx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions