-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exec command: Only switch branch when cloning #251
base: master
Are you sure you want to change the base?
Conversation
When using msync exec, I was surprised to learn it switched branches. My immediate impression was that it was simply a wrapper that executes commands on checkouts. This changes the commend to only switch branch when cloning the repository or when it's explicitly passed via the --branch option.
Codecov Report
@@ Coverage Diff @@
## master #251 +/- ##
==========================================
+ Coverage 87.20% 87.22% +0.02%
==========================================
Files 30 30
Lines 1016 1018 +2
==========================================
+ Hits 886 888 +2
Misses 130 130
Continue to review full report at Codecov.
|
Note that this is the |
🤔 quite unexpected as far as I think about it, yes. I had a similar issue but not exactly the same I think and @neomilium demonstrated me I was inconsistent and changing branch was better… Maybe it's not applicable here and maybe it's not applicable anymore anywhere after the recent refactoring, so let's let him shine and enlighten us: is this expected 😁 ? |
My first idea was to set I'm not so comfortable with the supplied patch as it produce a different behavior if cloned? or not. Maybe it could be an idea, to implement something like this:
@ekohl It seems we use a different workflow to use Nevertheless, I'm OK to merge this if main contributors too, maybe some behavior tests could help to keep the feature when the expected behavior were found. |
I'll share my previous example. I started work on something that wasn't ready, but I wanted to see the impact. So I started work on a change: $ msync update --noop -b my-change Then wanted to figure out what changed, so I ran $ msync exec -- git diff This led to unexpected results. Other actions I can imagine are Maybe my core issue is that I like having control over branches. Perhaps similar to
Any thoughts from @bastelfreak or @alexjfisher? I think you're semi-regular users. |
When using msync exec, I was surprised to learn it switched branches. My immediate impression was that it was simply a wrapper that executes commands on checkouts.
This changes the commend to only switch branch when cloning the repository or when it's explicitly passed via the --branch option.
Right now there are no tests (I did verify it manually) because I first want to figure out if this is a good idea. @smortex would you mind having a look?