-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Keep intermediate commits #78
Comments
Hi. Interesting approach. I wouldn’t use frequent commits as it breaks the flow. Not sure how the tool can help here. Also, the tool doesn’t create commits in nonwip branches by design - only in wip branches. I would like to keep it that way. What could help would be a mob next -m „custom message“ parameter. So you can name the commits. And mob done —merge could merge all the commits back to the base branch. What do you think? |
Hi. Great suggestions. That would really help with our workflow. Thinkig of it, creating commits only on WIP branches is probably a pretty good idea for most users. I can totally get behind that. Using I'm just currently thinking about two additions to the approach, which I'm not 100% sure about.
Both ideas would assume, that all team members have the same default commit message configured, so I'm not quite sure. What's your opinion? |
Detecting custom commits sounds quite fragile. Don’t like this approach to be honest. |
Sorry for the short answers but I’m on vacation right now... :-) |
Yeah, I totally understand. Wasn't quite sure myself. So, to sum up, you would be okay with the following additions?
No worries. Enjoy your time off and stay healthy out there :) |
Thanks. :-) The option —message should also be supported, not only the shorthand. Regarding the merge option, I am not entirely sure. It still makes a change in the base branch of the user. Maybe this should be done by the user instead? So basically the tool does everything except the actual merge, but displays a command to copy if one wants to do that. Something like: to complete the merge, enter this command and the following commits with those commit messages will be part of your base branch. What do you think? |
On second thought, the standard mob done also makes a change to the base branch - although only to the index and no commit. So this might be ok, I guess. |
Back now. Do you want to have a go at the two additions? I'd be happy to review it. :-) |
Sorry, we had some dead lines looming and I just forgot to answer. Yeah, I'll give it a try. I don't have that much time currently so this could take a while (also my first time writing in Go).
Good point. Thinking of it, should there be a shorthand for the
Personally I'd prefer the Thinking of it since |
Awesome. Looking forward your PR. I would refrain for having a shortcut for merge, as this is somewhat dangerous and I don’t want to make this too easy. :-) |
I want to release a new version soon. So I had a go at the |
Wow, thank you very much! Sorry I didn't find the time for a PR. My son's sleep schedule is currently out of order and I'm really exhausted in my spare time. Looking at your commit I realise, that I also overestimated the amount of work needed for such a change 😄 Again thank you very much. I hope everything will be more relaxed here in the next few weeks, so I may have a look at the |
No worries. I do have two children of my own, and I know how important their sleep schedule is to my well being. :-) |
one idea comes to mind: |
@simonharrer Plesse correct me if I'm wrong, but you should be able to just use a normal |
mob next won’t interfere - you can commit manually anytime. Just be aware that mob done currently squashes the manual commits as well. |
let's say i'm doing 3 microsteps before my handover and i want all those to be kept (not squashed) in my history. |
that was the idea of having the merge option. Instead of squashing all commits, all will be merged back in the base branch. Something in between (some commits are squashed and some kept) is not really feasible. The merge option is discussed above. |
hm. my idea was more like: not detecting custom commits, but detecting mob tool commits. so you would
upon |
This seems to work in the meantime:
At this point, we have some "published" commits and we have some WIP commits. If you use It might help, then, simply to add a I don't know the workflow thoroughly enough to feel sure that this always works, but it seems to pass the laugh test for me, so I'll rebase-then-push by hand in my sessions and maybe I'll discover a problem along the way. Can anyone already see a problem? Would this "mob publish" command that I'm proposing help enough to be worth it? |
I would say the "behind the curtain" and "automagically" part will be a problem in your proposed solution. As far as I understood @jbrains If I understand correctly, |
@simonharrer Finally found some time fiddling around. I'm still getting used to Go, so no PR yet ;) I managed to read in the Maybe we should use something like |
I've tried to summarize the goal of this ticket. Basically, there are three modes of using mob:
The tool currently supports 1 and 2. In this part of the ticket, we focus on 3. One solution is now to add a Things to consider:
@jbrains I'm really hesitant to go in the direction of having such a publish command. A design principle of mob is not to interfere with branches of the user (the base branch), only write/change wip branches. That's basically my biggest concern with the --keep-commits option above - although it only moves the local pointer of a branch forward in the best case. But with your proposal of doing a rebase and a push, this design principle would no longer hold - and I kind of really like this way of branch ownership. It keeps the tool simple and any user with any preferences on how they manage their own branches can use it. |
suppose to keep it user-centric i would not throw away a users commit by default. meaning would probably be a groundbreaking change. but it feels right from a user-perspective at least. |
@gregorriegler to me, this case of keeping commits is basically a 5% use case whereas having mob manage the short living temporary branch is the 95% case - although I have no data to prove it, just an educated guess. I don't want to optimize too much for the 5% case. I really want to keep the 95% case as simple as possible. |
@simonharrer Since you want One other possibility is to have a command like |
Oh, I didn't realize, mob preserves those messages. That's also a very interesting feature 👍
Intuitively I would expect those uncommited changes to appear as staged changes. We could also print some kind of message telling the user about those uncommited changes. So this would be consistent with the normal
Yeah, that behavior should be documented well. But from a user perspective I'd say it is not that different. It is just the way the wip changes are played back into my normal branch. As long as we do not call
Good point! I was thinking about something like
If the merge fails, I would expect mob to abort the whole operation but also help me resolve the issue. So there should be an error message explaining what went wrong and maybe also a list of commands to execute to resolve the issue. Also it should be consistent with the current bevavior. To be honest I'm not quite sure how conflicts are currently managed. So what happens if we edit a file in a mob-session while someone else removes it from the main branch?
I would say no. I'd expect mob to call |
@jbrains good point. I've updated the documentation and the help info so it becomes clear that it'll do a squash. Thanks for your input @koeberlue At the moment, mob done issues a |
@simonharrer Great idea! Since "mob is a thin wrapper around git" there is no need to reinvent the wheel. Just give the user a possibility to slightly modify the git commands with flags (potentially) already known to the user. 👍 |
@koeberlue sounds great. I Anyone interested in doing a mob session to get this feature going? |
Yes! Should we use the new Github Discussions feature to schedule a meeting? That way we will not spam this issue |
Let's do this. #92 |
Maybe something to consider, not sure if I understand this correctly. When you do
you would have the handover commit from (2.) in the mainline. unless you squash it manually. is this what we are aiming for? or do I not understand? |
sorry for the accidental close, missclick 🙄 |
Basically, I want to exclude the hybrid approach for now, meaning, one cares about great commits but uses So, I propose to support two modes:
and
In the hybrid approach, one would need to do a rebase, probably interactively. This doesn't work well with a CLI tool that's fire and forget as the mob tool currently is. |
Hm, it could mean that we have two different modes with different arguments being optional or required. The default mode would have an optional message at mob next whereas the mob next in the second mode requires a message parameter to be present. |
I would argue that this parameter is optional in the second mode as well. If I did meaningful changes, I can add a commit message. If I only want to do the handover on "dirty" changes I will still use the default message. When I dive into the git log I will then see those dirty commits and can just ignore them. Getting rid of the handover commit, as @gregorriegler is proposing, would then be a nice addition, but for me this would not be mandatory for this issue |
ok. but this would then be doeable by changing the wip-commit message to "!squash wip" and by following up with an |
@gregorriegler thanks for pointing out |
@koeberlue I also didn't know. @simonharrer told me about the |
Closing this for now, as v1.1.0 now has the |
It would be nice if you could keep all commits that were not created by
mob next
.We are used to make very fine grained commits, like write a failing test, commit, write code to pass test, commit. Discussing commit messages is usually part of the mobprogramming. So it would be really nice to have a way to keep intermediate commits when calling
mob done
.Alternatively there could be a way to call
mob done
without actually ending the mob session. Something likemob commit "some message"
which would effectively do:mob done && git commit -m "some message" && git push && mob start <remaining timer>
This would solve our problem for now but i can see that this probably would not work for all teams.
What do you think? Would this be a useful feature or do the frequent commits just break the flow to much?
The text was updated successfully, but these errors were encountered: