On 18/11/2020 10:15, Tassilo Horn wrote:
>> I think you can just have a very simple script that
>> for each branchX in branchList
>>   git checkout branchX
>>     for each branchY in branchList
>>       mergeResult = git merge branchY
>>       if mergeResult
>>         git reset HEAD~
>>       else
>>         notify about conflict between branchX and branchY
>>         git merge --abort
> That's a good starter, although I'd rather have a less precise solution
> which doesn't require that I've already done and committed my changes,
> i.e., I'd rather run the script *before* I start changing anything.  So
> maybe something along these lines.
I know the 'before' feeling (!), but isn't that one of the 'git smells'
(like code smells..) where we should be using a quick temporary branch
for a side commit, or a WIP-on-top (almost the same as a stash) so that
you do have a temporary local revision (blobs/trees/commit) stored
*early*, just in case of mistakes.

Likewise, it's taken me a long time to stop having a local 'main' (was
master) branch that mimics (duplicates) the upstream origin/main RTB to
no real benefit.

This feeling of wanting to check that stuff is ok before committing has
the same psychological safety worries that we've carried over from older
centralised VCS systems (public shame & blame;-). I had one this morning
where I tried out a bit of Octave code that was supposed to be a simple
renaming of variables that crashed, which though gritted teeth I
committed, with note of the issue, then amended after I'd found the name
clash, so I didn't lose all the good work for just one typo ;-)

Do we have a "git smells" list?
--
Philip

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/8b11f1be-fb0b-46dd-618c-3d377e624c70%40iee.email.

Reply via email to