gitbutlerapp / gitbutler

The GitButler version control client, backed by Git, powered by Tauri/Rust/Svelte
https://gitbutler.com
Other
13.18k stars 523 forks source link

Discarding changes doesn't function #5222

Open ipsquiggle opened 2 weeks ago

ipsquiggle commented 2 weeks ago

It currently seems impossible to discard a change through the GitButler UI.

I've tried both

Tested in v0.13.2, Windows 10

Let me know if there's any other information I can provide.

Byron commented 2 weeks ago

Thanks for reporting!

Last time I checked I noticed that it was only able to discard worktree changes, but not anything else, i.e. changes that are added to the index, or files removed from the index.

Is this what you are describing here, or there more to it that should be shared? Thanks again.

ipsquiggle commented 2 weeks ago

@Byron I don't think I'm doing anything fancy.. my workflow is 100% GitButler.. I make some change (i.e. adding a logging line) that I later want to remove. I right click on the change and "Discard" and nothing happens.

I've tried this after rebooting, on different branches, etc. The behaviour is perfectly consistent for me, my experience is that this feature simply doesn't work.

I have just attempted to discard using both the methods described in the OP, and then chose the "Share Debug Info" with a reference to this issue. I hope that helps!

Byron commented 2 weeks ago

Thanks a lot for the heads-up and for sending the report. This means the logs where sent to the team. You can also take a look at them yourself, I'd expect an error to show up right after trying to discard an entry. Maybe you could also share that here.

ndom91 commented 2 weeks ago

Thanks for also sharing your logs!

The only I saw in the backend side was the following.

2024-10-21T20:35:55.942022Z ERROR get_project_data_archive_path: crates\gitbutler-tauri\src\zip.rs:27: error=Error(C:\Users\graha\AppData\Roaming\com.gitbutler.app\projects\4909531c-4182-4d35-8e2c-5f37d84b44dd does not exist) project_id="4909531c-4182-4d35-8e2c-5f37d84b44dd"

However, on the frontend there were a bunch of these which could hang up certain other eventListeners:

[2024-07-09][01:27:23][ERROR][webview::unknown] Unhandled exception: Error: Commit dbb6fa192b7b446331fcb43644a730c426093d4a not found in commitIndexes undefined

I believe that commitIndexes issue has been fixed in the latest release(s) though. Could you give the latest release or nightly another try? :pray: (https://app.gitbutler.com/downloads)

ipsquiggle commented 1 week ago

This still occurs on the 0.13.6.

To narrow down the logs, I marked the log file, switched to the GitButler window, tried discarding a change, and then copied the newly added lines from the log. Here's those lines.

I agree, there's nothing in there that looks like an error...

Note: there were no new lines added to the ui-log.log when performing these actions.

Discarding from the file view:

2024-10-23T17:32:46.508295Z  INFO unapply_ownership: crates\gitbutler-tauri\src\virtual_branches.rs:236: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:32:46.512492Z  INFO unapply_ownership:create_snapshot: crates\gitbutler-oplog\src\oplog.rs:152: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:32:46.545906Z  INFO unapply_ownership:create_snapshot: crates\gitbutler-oplog\src\oplog.rs:152: close time.busy=33.4ms time.idle=14.7µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:32:46.895272Z  INFO unapply_ownership: crates\gitbutler-tauri\src\virtual_branches.rs:236: close time.busy=387ms time.idle=10.4µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:32:46.895655Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: new event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:32:46.895665Z  INFO handle:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:93: new event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:32:47.027996Z  INFO handle:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:93: close time.busy=132ms time.idle=5.40µs event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:32:47.028016Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: close time.busy=132ms time.idle=10.0µs event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:32:47.029121Z  INFO list_branches: crates\gitbutler-tauri\src\virtual_branches.rs:429: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd filter=Some(BranchListingFilter { local: None, applied: None })
2024-10-23T17:32:47.029609Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: new name="Virtual branch"
2024-10-23T17:32:47.029618Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: close time.busy=2.30µs time.idle=8.00µs name="Virtual branch"
2024-10-23T17:32:47.029629Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: new name="banana"
2024-10-23T17:32:47.029635Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: close time.busy=1.40µs time.idle=4.70µs name="banana"
2024-10-23T17:32:47.030297Z  INFO get_blob_info: crates\gitbutler-tauri\src\repo.rs:72: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd relative_path="script/character.wren" commit_id=None
2024-10-23T17:32:47.031807Z  INFO get_blob_info: crates\gitbutler-tauri\src\repo.rs:72: close time.busy=1.50ms time.idle=11.2µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd relative_path="script/character.wren" commit_id=None
2024-10-23T17:32:47.034622Z  INFO list_branches: crates\gitbutler-tauri\src\virtual_branches.rs:429: close time.busy=5.49ms time.idle=9.40µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd filter=Some(BranchListingFilter { local: None, applied: None })
2024-10-23T17:32:47.088144Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.name"
2024-10-23T17:32:47.088167Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.name"
2024-10-23T17:32:47.088976Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=803µs time.idle=5.40µs key="user.name"
2024-10-23T17:32:47.088996Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=843µs time.idle=9.90µs key="user.name"
2024-10-23T17:32:47.089958Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.email"
2024-10-23T17:32:47.090001Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.email"
2024-10-23T17:32:47.090647Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=640µs time.idle=4.90µs key="user.email"
2024-10-23T17:32:47.090657Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=690µs time.idle=9.80µs key="user.email"

Discarding from the hunk view:

2024-10-23T17:34:45.946924Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: close time.busy=59.4µs time.idle=18.1µs id=4909531c-4182-4d35-8e2c-5f37d84b44dd window="main" project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd fs_events=34 fs_events=34 ignored=0 ignored=0 git_noop=34 git_noop=34 git=0 git=0 project=0 project=0
2024-10-23T17:35:13.035314Z  INFO unapply_ownership: crates\gitbutler-tauri\src\virtual_branches.rs:236: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:35:13.039306Z  INFO unapply_ownership:create_snapshot: crates\gitbutler-oplog\src\oplog.rs:152: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:35:13.075013Z  INFO unapply_ownership:create_snapshot: crates\gitbutler-oplog\src\oplog.rs:152: close time.busy=35.7ms time.idle=15.9µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:35:13.383212Z  INFO unapply_ownership: crates\gitbutler-tauri\src\virtual_branches.rs:236: close time.busy=348ms time.idle=16.6µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd ownership=BranchOwnershipClaims { claims: [OwnershipClaim { file_path: "script/character.wren", hunks: [Hunk { hash: Some(d6ca48e7aa50a7eaa42459e451fb0ab1), start: 15, end: 22 }] }] }
2024-10-23T17:35:13.383397Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: new event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:35:13.383408Z  INFO handle:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:93: new event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:35:13.503383Z  INFO handle:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:93: close time.busy=120ms time.idle=5.00µs event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:35:13.503424Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: close time.busy=120ms time.idle=10.4µs event=VirtualBranch(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:35:13.504440Z  INFO list_branches: crates\gitbutler-tauri\src\virtual_branches.rs:429: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd filter=Some(BranchListingFilter { local: None, applied: None })
2024-10-23T17:35:13.505047Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: new name="Virtual branch"
2024-10-23T17:35:13.505057Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: close time.busy=2.30µs time.idle=9.20µs name="Virtual branch"
2024-10-23T17:35:13.505434Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: new name="banana"
2024-10-23T17:35:13.505441Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: close time.busy=1.80µs time.idle=7.00µs name="banana"
2024-10-23T17:35:13.506189Z  INFO get_blob_info: crates\gitbutler-tauri\src\repo.rs:72: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd relative_path="script/character.wren" commit_id=None
2024-10-23T17:35:13.507508Z  INFO get_blob_info: crates\gitbutler-tauri\src\repo.rs:72: close time.busy=1.31ms time.idle=9.70µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd relative_path="script/character.wren" commit_id=None
2024-10-23T17:35:13.510132Z  INFO list_branches: crates\gitbutler-tauri\src\virtual_branches.rs:429: close time.busy=5.68ms time.idle=10.8µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd filter=Some(BranchListingFilter { local: None, applied: None })
2024-10-23T17:35:13.563197Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.name"
2024-10-23T17:35:13.563229Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.name"
2024-10-23T17:35:13.563965Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=757µs time.idle=11.1µs key="user.name"
2024-10-23T17:35:13.563971Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=736µs time.idle=5.90µs key="user.name"
2024-10-23T17:35:13.564889Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.email"
2024-10-23T17:35:13.564998Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.email"
2024-10-23T17:35:13.565544Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=647µs time.idle=8.70µs key="user.email"
2024-10-23T17:35:13.565709Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=703µs time.idle=7.50µs key="user.email"
2024-10-23T17:35:13.806096Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: new id=4909531c-4182-4d35-8e2c-5f37d84b44dd window="main" project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd
2024-10-23T17:35:13.840050Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: close time.busy=33.9ms time.idle=19.6µs id=4909531c-4182-4d35-8e2c-5f37d84b44dd window="main" project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd fs_events=2742 fs_events=2742 ignored=0 ignored=0 git_noop=2727 git_noop=2727 git=2 git=2 project=4 project=4 git_dedup=2 git_dedup=2 project_dedup=4 project_dedup=4
2024-10-23T17:35:13.840103Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: new event=GitFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, logs\HEAD, index)
2024-10-23T17:35:13.840226Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: new event=ProjectFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, script\character.wren, script\ui, script, script\ui\quitDialog.wren)
2024-10-23T17:35:13.840237Z  INFO handle:recalculate_everything: crates\gitbutler-watcher\src\handler.rs:129: new event=ProjectFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, script\character.wren, script\ui, script, script\ui\quitDialog.wren) paths=4
2024-10-23T17:35:13.840250Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: new event=GitButlerOplogChange(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:35:13.840266Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: close time.busy=156µs time.idle=6.40µs event=GitFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, logs\HEAD, index)
2024-10-23T17:35:13.841575Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: close time.busy=1.32ms time.idle=8.60µs event=GitButlerOplogChange(4909531c-4182-4d35-8e2c-5f37d84b44dd)
2024-10-23T17:35:13.904312Z  INFO handle:recalculate_everything:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:93: new event=ProjectFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, script\character.wren, script\ui, script, script\ui\quitDialog.wren) paths=4
2024-10-23T17:35:13.928370Z  INFO handle:recalculate_everything:calculate_virtual_branches: crates\gitbutler-watcher\src\handler.rs:93: close time.busy=24.0ms time.idle=29.8µs event=ProjectFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, script\character.wren, script\ui, script, script\ui\quitDialog.wren) paths=4
2024-10-23T17:35:13.928416Z  INFO handle:recalculate_everything: crates\gitbutler-watcher\src\handler.rs:129: close time.busy=88.2ms time.idle=2.60µs event=ProjectFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, script\character.wren, script\ui, script, script\ui\quitDialog.wren) paths=4
2024-10-23T17:35:13.928423Z  INFO handle: crates\gitbutler-watcher\src\handler.rs:57: close time.busy=88.2ms time.idle=10.3µs event=ProjectFileChange(4909531c-4182-4d35-8e2c-5f37d84b44dd, script\character.wren, script\ui, script, script\ui\quitDialog.wren)
2024-10-23T17:35:13.929190Z  INFO list_branches: crates\gitbutler-tauri\src\virtual_branches.rs:429: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd filter=Some(BranchListingFilter { local: None, applied: None })
2024-10-23T17:35:13.929645Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: new name="Virtual branch"
2024-10-23T17:35:13.929654Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: close time.busy=2.30µs time.idle=7.00µs name="Virtual branch"
2024-10-23T17:35:13.929686Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: new name="banana"
2024-10-23T17:35:13.929689Z  INFO normalize_branch_name: crates\gitbutler-tauri\src\virtual_branches.rs:24: close time.busy=600ns time.idle=2.20µs name="banana"
2024-10-23T17:35:13.930207Z  INFO get_blob_info: crates\gitbutler-tauri\src\repo.rs:72: new project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd relative_path="script/character.wren" commit_id=None
2024-10-23T17:35:13.932195Z  INFO get_blob_info: crates\gitbutler-tauri\src\repo.rs:72: close time.busy=1.97ms time.idle=21.5µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd relative_path="script/character.wren" commit_id=None
2024-10-23T17:35:13.934577Z  INFO list_branches: crates\gitbutler-tauri\src\virtual_branches.rs:429: close time.busy=5.38ms time.idle=5.50µs project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd filter=Some(BranchListingFilter { local: None, applied: None })
2024-10-23T17:35:13.986147Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.name"
2024-10-23T17:35:13.986193Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.name"
2024-10-23T17:35:13.986986Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=787µs time.idle=5.50µs key="user.name"
2024-10-23T17:35:13.986989Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=832µs time.idle=10.2µs key="user.name"
2024-10-23T17:35:13.988010Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.email"
2024-10-23T17:35:13.988079Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: new key="user.email"
2024-10-23T17:35:13.988725Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=708µs time.idle=7.10µs key="user.email"
2024-10-23T17:35:13.988819Z  INFO git_get_global_config: crates\gitbutler-tauri\src\commands.rs:88: close time.busy=734µs time.idle=4.70µs key="user.email"
2024-10-23T17:35:14.808974Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: new id=4909531c-4182-4d35-8e2c-5f37d84b44dd window="main" project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd
2024-10-23T17:35:14.809048Z  INFO set_project_active:set_project_to_window:file monitor:handle debounced events: crates\gitbutler-watcher\src\file_monitor.rs:119: close time.busy=58.0µs time.idle=16.7µs id=4909531c-4182-4d35-8e2c-5f37d84b44dd window="main" project_id=4909531c-4182-4d35-8e2c-5f37d84b44dd fs_events=34 fs_events=34 ignored=0 ignored=0 git_noop=34 git_noop=34 git=0 git=0 project=0 project=0
ipsquiggle commented 1 week ago

I'm sure you understand what I'm saying, but here's a quick video just to make it abundantly clear. 😁

2024-10-23_10-44-36_PowerToys_wM6laPtw8Q.webm

ndom91 commented 1 week ago

Thanks for the logs and video!

Unfortunately I'm not seeing anything related to the rust function that that "Discard Changes" button invokes, reset_files anywhere in the logs. Is it possible that you truncated them a bit early / late?

Also just to be sure, when clicking the "Discard" context menu item, you don't see any errors or other messages in the web console? (You can open it view "View -> Developer Tools")

ipsquiggle commented 1 week ago

@ndom91 I checked the logs multiple times, different ways, refreshing, etc. and saw no additional lines show up.

I checked the web console, I get this single error when clicking the confirm button in the dialog, but no other errors, and no errors when choosing "discard" from the hunk context menu. image