git2consul icon indicating copy to clipboard operation
git2consul copied to clipboard

'git mv ...' doesn't remove old file from kv

Open robottaway opened this issue 8 years ago • 5 comments

I run the command 'git move filename1 filename2' after git2consul picks up changes both filename1 and filename2 are in the KV.

robottaway avatar Jul 12 '16 18:07 robottaway

We will need to add test coverage for this case as well as the one mentioned in #80 regarding branch switching.

calvn avatar Jul 13 '16 03:07 calvn

Ok I can take a look later tonight and report back. I will look into #80 also.

robottaway avatar Jul 14 '16 00:07 robottaway

I wonder if passing --no-renames in https://github.com/Cimpress-MCP/git2consul/blob/master/lib/git/commands.js#L86 would solve this, since it should show filename1 being removed and filename2 being added. I don't know how to write node, or I'd submit a PR.

jtambolic1 avatar Aug 07 '17 16:08 jtambolic1

I just added the --no-renames flag to that line to resolve the fact that the test suite was now failing on Travis CI since they'd upgraded to git 2.13.0 from 1.9.1 where it was before. I suspect that @calvn's test was catching the root cause of this. @robottaway can you verify which version of git you were using git2consul with and possibly retest with the code in the master branch?

breser avatar Aug 12 '17 03:08 breser

As a workaround until this fix is released, you can add

[diff]
        renames = false

to .git/config in the repo that git2consul monitors.

sgrimm-sg avatar May 15 '18 19:05 sgrimm-sg