rtc2git icon indicating copy to clipboard operation
rtc2git copied to clipboard

no changes detected when files are only added

Open BalzGuenat opened this issue 6 years ago • 3 comments

git diff is used to determine whether there are any changes. git diff is empty if only new, untracked files are added. This halts the migration process and asks the user for input.

I suggest one of the following solutions:

  1. Use git status instead of git diff.
  2. Use git add -A, then git diff --cached, i.e. stage earlier.

BalzGuenat avatar May 07 '19 10:05 BalzGuenat

Hi Balz

Thanks for reaching out for this! :) In fact we use git status in some context (handling ignores) already. Im cant exactly remember why we have choosen git diff instead of git status, but I think I didnt want to have any accidently .jazz folders added.

I will keep this open and make some tests with it. Could probably take some time (since I dont have much free time nor a testing workspace).

WtfJoke avatar May 10 '19 08:05 WtfJoke

diff has the nice property of a changing exit code depending on whether there are changes or not. status doesn't have that I believe, so is harder to work with.

I tried out option 2 and found no problems migrating a ~400 change set repo. If you want I can make a pull request.

BalzGuenat avatar May 11 '19 08:05 BalzGuenat

Sure, would be glad if you make a pull request.

As I said probably take some time until I can merge it.

WtfJoke avatar May 12 '19 19:05 WtfJoke