1

I'm using git as part of a script automating a file patch. It goes something like this:

cd "$gitdir"
git checkout original
monodis "$original_dll" > "$ilfname"
git add "$ilfname"
git commit -m "$(date +"%s")"
git checkout modded
git rebase original

# More code here

As you can probably guess - this disassembles a .NET dll and applies a few patches by way of git.

But what happens if there's a merge conflict? Is there a way to "Pause" the script until the rebase is completed?

J V
  • 11,402
  • 10
  • 52
  • 72
  • I'm on a computer that has neither git nor bash installed, but you might be able to leverage the exit status of the `git rebase` command. I _think_ it's nonzero if there's a merge conflict, but I could be wrong. – shadowtalker Jun 13 '15 at 15:56
  • See this: [How to determine if Git merge is in process](http://stackoverflow.com/q/30733415/2790048) – Nick Volynkin Jun 13 '15 at 16:00
  • ssdecontrol, Nick: Wouldn't that require me to start a loop with a delay and check over and over whether the merge was done? – J V Jun 13 '15 at 16:09

1 Answers1

0

You could split your script in two, the first part calling the second one upon a conflict-less rebase. In case of manual intervention needed the operator would call the second part after completing the merge.

Mykola Gurov
  • 8,517
  • 4
  • 29
  • 27