timbrel / GitSavvy

Full git and GitHub integration with Sublime Text
MIT License
1.9k stars 135 forks source link

Rebase view is empty #1870

Closed IPWright83 closed 4 months ago

IPWright83 commented 4 months ago

I've got a branch, which I just rebased to master. This was mostly done via the command line as I'm generally unfamiliar with rebasing and just getting comfortable with the commands. However I do find the Sublime UI really easy for squashing commits, so I jumped to the rebase tab, but it's empty.

I do see an error:

SublimeLinter: WARNING: 'README.md' puts in total 9(!) tasks on the queue:  9x eslint.
WARNING:SublimeLinter.lint.backend:'README.md' puts in total 9(!) tasks on the queue:  9x eslint.
Exception in thread Thread-10:
Traceback (most recent call last):
  File "./python3.8/threading.py", line 932, in _bootstrap_inner
  File "./python3.8/threading.py", line 870, in run
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/runtime.py", line 135, in wrapped
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 981, in reader
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 488, in consume
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 395, in normalize_tokens
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 349, in simplify
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 317, in diff
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 945, in filter_consecutive_continuation_lines
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 825, in process_graph
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/commands/log_graph.py", line 516, in try_kill_proc
  File "/Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/utils.py", line 369, in kill_proc
ProcessLookupError: [Errno 3] No such process
Abort: View already closed.  [ /Users/ian/Library/Application Support/Sublime Text 3/Installed Packages/GitSavvy.sublime-package/core/git_command.py:641 ]
branch component-scaffold not found in header information
Unable to open /Users/ian/Library/Application Support/Sublime Text 3/Packages/GitSavvy/GitSavvy.sublime-settings

But I can run git log (don't know if that's what GitSavvy uses) without any problems on the command line fine. Any ideas on why this might be broken?

kaste commented 4 months ago

Is the view completely blank?

There are two errors here: ProcessLookupError: [Errno 3] No such process That's a good finding. You had the graph open here and you changed/closed the view before it had finished rendering. In that case we try to kill the git graph process but that was already gone at that point. I should catch that error as drawing the view (in Sublime) is usually slower than the git process. 👍 ("Abort: View already closed." also indicates that an operation was still pending but the view got closed.)

Unable to open /Users/ian/Library/Application Support/Sublime Text 3/Packages/GitSavvy/GitSavvy.sublime-settings is strange. Maybe you have an orphaned file there? You should check that as you actually running from "Installed Packages" here as it seems. Make sure you don't have overrides active.

The rebase itself is not throwing here. "branch component-scaffold not found in header information" indicates that you have more refs/branches as git show-branch can handle. But I also have that.

Note though that the "rebase" view is deprecated and everything moves to the graph view where you have the special rebase menu bound to [r] already. If the cursor is on the HEAD commit, then the main menu on [enter] should also show Rebase on... which will do something very typical, like git rebase origin/master.

image

IPWright83 commented 4 months ago

So no, it's not completely blank. Just not showing any commits, sorry for not being specific before.

image

I hadn't realised the rebase view was deprecated. I re-enabled it as I couldn't find the commands like squash etc (and the graph view just goes on forever so I obviously didn't find a help menu at the bottom). Having had a quick look at the graph view (which I barely used to be honest) that does correctly list my commits. I might have to start giving it a try, though personally I do like the rebase view as being a lot more succinct.

kaste commented 4 months ago

Hm, if you just rebased there is maybe nothing between component-scaffold and origin/component-scaffold? I'm not an expert for this view but I think you have to use f to compare it with something else.

The view is succinct but the backend is in python and not using git itself. (It is a re-implementation of the rebase feature. I mean rebasing is moving refs around and cherry-picking commits after all :grin:.)

Now in GitSavvy to get a shorter graph... One way ... You can get that for example using the branches dashboard. Put the cursor on the integration branch, i.e. origin/master, and press [H]. That will compare origin/master with the current branch.

kaste commented 4 months ago

Hm, something for the documentation:

In the graph view, [s] for the overview

image

Then e.g. ctrl+r (search for local symbol)

image

Then in the main menu [enter]:

image

IPWright83 commented 4 months ago

Ok, it's a bit convoluted but that gets you to a similar view as the previous one - from there is there a way to squash all commits? Or do I have to do that manually now?

kaste commented 4 months ago

Na, that's not in there right now. "squashing all commits" is an edge case workflow. But squashing or melting fixups would work automatically, also just rewording a commit message.

"Squash all commits" is basically "reset --soft ", and then "commit" as usual. You could do that within Sublime/GitSavvy, esp. using the graph view very quickly.

IPWright83 commented 4 months ago

I'm gonna close this. Thanks for your help @kaste.

I'm still using the old rebase view, 🤞🏻 you don't remove it completely, but I understand if you do!