Merge dry run option for local branches + random tip `'join the team" expression of interest #3004
Replies: 2 comments 4 replies
-
Hey @jackoconnordev glad you wanna join the team :) The feature makes sense. I haven't tested out the bash snippet you pasted but if it can reliably test the merge without affecting the working tree then that's pretty good. We could make it so that when you press shift+m on a branch, rather than showing a confirmation prompt we show a menu with two items: one for merging and one for dry-run merging. The merge options menu that comes up when you press 'm' shouldn't need to change. I assume if there are no conflicts we raise an alert and tell the user that, but what happens if there are conflicts? Do we say 'there will be conflicts' or do we actually specify what they are? |
Beta Was this translation helpful? Give feedback.
-
Hi @jesseduffield, thanks for responding! Reliability of dry run mergeThe dry run merge snippet I have works the same as a regular merge in the sense that before attempting a dry run any uncommitted changes in the local directory must either be committed or stashed. When the dry run finishes and aborts the merge with Current lazygit/git output when attempting to merge with unstashed changes The Dry run snippet without conflict Usage within lazygitI think the way I've been using it is just to test if there are merge conflicts or not when I'm working on several branches at the same time. In that case just an alert that there are or aren't merge conflicts would satisfy me I think. Also, how would you feel about putting the dry run merge on <c-m> and that way the current merge commands/muscle memory can be left alone? |
Beta Was this translation helpful? Give feedback.
-
Hi, to start with I'd just like to say how much I enjoy using lazygit and how much of an educational experience it has been for me in terms of learning more git features.
Idea
Sometimes before I push to a remote I want to check if a branch I'm on will have merge conflict errors with the default branch of the remote I'm working on, without actually merging in the case that there are no conflicts.
Right now I believe the current way to do this is to attempt a merge, and if successful undo the merge by pressing "z". This isn't a massiva pain by any means, but conceptually I like the idea of having a shortcut dry-run merge option which does not alter my local git files and it is a command that I currently run by exiting lazygit to have autocompletion for long branch names on the regular git command line tool, vs the custom command entrybox in lazygit.
A dry-run option inside the merge/rebase options could be a nice feature to have in terms of having a no-cost merge checking option directly in lazygit.
Example git dry-run snippet
Snippet source: https://gist.github.com/kewang/e97b0018237a65c6f80951bee4715a9b
Reference images
Want to check if dry-run branch has merge conflicts with master
Press "m" for merge/rebase options
Attempt dry-run could go here
Join the team expression of interest
I also saw the expression of interest message in the command log while using lazygit. I'd be interested in trying to help even a little bit for both the general experience, git experience and because this is a tool I actively use.
I've recently started working full-time as a software engineer and regular open source contributions are something I'd like to work up to. I work on containerised applications which are deployed to kubernetes clusters, so I have an interest in familiarising myself with Go so that I can better understand the various controllers that the devops team have coded.
I'd also like to get experience working with a compiled language as I primarily use TypeScript, and the only other languages I have used regularly are Python and R which are also scripting languages.
Random tip message
Beta Was this translation helpful? Give feedback.
All reactions