+2

Please, stop making the `continue` rebase button forcing me to commit untracked files

Bugged 4 years ago updated by Jeff Jensen 3 years ago 3

For example, I just had went back on history where some directories were not on `.gitgnore`:

Image 487

But now I just cannot continue rebasing because Smartgit `Continue` rebase button is making/keeps opening the `Commit` dialog.

Not so far ago, Smartgit would be smart and just ask whether I would like to commit the unstaged files, but now it just becomes an insane/senseless application, version: 20.1.1 #15128

The only for me to get out of this nonsenseless is to open the command line and directly run `git rebase --continue`

Create the following shell script called `test.sh`:

```

#!/usr/bin/env bash
printf '\nCreate the directory structure\n'
rm -rf main_repo

printf '\nSetup the main_repo\n'
mkdir -p main_repo
cd main_repo
git init

printf '\nCreate test files\n'
printf 'Some thing.
' > some.txt

git add some.txt
git commit -m "Added the some.txt"

mkdir -p ignored
printf 'Some thing1 ignored.
' > ignored/some1.txt

printf 'Some thing2 ignored.
' > ignored/some2.txt

printf '
/ignored/**
' >> .gitignore

git add .gitignore
git commit -m "Created .gitignore"

printf '\nCreate root commit\n'
tree=`git hash-object -wt tree --stdin < /dev/null`
commit=`git commit-tree -m 'root commit' $tree`
git branch newroot $commit
git rebase --onto newroot --root master

printf '\nRebasing back\n'
git rebase -i --rebase-merges HEAD~2

```

Now run it with `bash test.sh`

The terminal will open this window:

```

label onto

reset onto
pick 2a414b1 Added the some.txt
pick bd01b55 Created .gitignore

# Rebase 9e3892e..bd01b55 onto 9e3892e (4 commands)
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop = remove commit
# l, label = label current HEAD with a name
# t, reset = reset HEAD to a label
# m, merge [-C | -c ] [# ]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified). Use -c to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out

```

Now you edit the line `pick 2a414b1 Added the some.txt` to `edit 2a414b1 Added the some.txt`

Now, you close your text editor allowing git to stop and pick the first commit.

Now you open the `main_repo` repository with Smartgit and you will get your window in the following state:

Now, after hitting the `Continue` button on the Smartgit interface, Smartgit will open the commit Window (no questions asked!). I do not want to commit these files! Only by running `git rebase --continue` on the command line allows me to continue the rebase without having to commit untracked files!

What command-line invocation specifically? I just did shell script because it was easier than explaining how you should build the repository using the SmartGit interface.

Yes, I stash them as my workaround and then unstash when complete.  Not difficult, but surprising it forces me to.  My guess is it is a protective measure.