Skip to content

Commit

Permalink
Prevent git commands from launching an interactive editor
Browse files Browse the repository at this point in the history
Since git switched its rebase backend from apply to merge, it launches
a commit message editor on `git rebase --continue`. This causes
rebase-helper to hang indefinitely.
Prevent that from happening by explicitly reconfiguring the editor in
the git repo.

Signed-off-by: Nikola Forró <nforro@redhat.com>
  • Loading branch information
nforro committed Jun 19, 2020
1 parent fb79efc commit 8f3e00f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rebasehelper/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def init_git(cls, directory):
repo.git.config('rebasehelper.state', state, local=True)
repo.git.config('user.name', GitHelper.get_user(), local=True)
repo.git.config('user.email', GitHelper.get_email(), local=True)
# prevent git commands from launching an interactive editor
repo.git.config('core.editor', 'true', local=True)
repo.git.add(all=True)
repo.index.commit('Initial commit', skip_hooks=True)
return repo, state
Expand Down

0 comments on commit 8f3e00f

Please sign in to comment.