On 7/28/2015 9:18 PM, Warren Young wrote:
> On Jul 28, 2015, at 9:32 AM, Gour <[email protected]> wrote:
>> split commit within one file
>> in smaller chunks when one forgets to ’safe often, commit often’ or
>> simply wants to divide single commit into several ones?
> 
> That said, it would be spiffy to have a “fossil ci --cherrypick”
> option that would ask me yes/no questions about each diff section,
> then commit all those I said “yes” to, leaving the “no” sections
> uncommitted.

I've wanted this too, but I know it's a bad idea.  The trouble is that
each commit ought to first be tested (at least checked to be sure it
compiles).  Partial commits (even checking in only selected files)
result in the committed version not matching the on-disk version
therefore not being tested.

When you realize you've made more than one check-in's worth of edits,
run "fossil stash save" to save what you have and revert to your
baseline.  Do "fossil stash show" to review the not-yet-committed
changes, and apply pieces by hand.  Or do "fossil stash apply" to put
all the remaining changes in place, then selectively back out changes.

I do this in vim by opening a file, typing ":new" to vertically split
with a new buffer, then typing ":%!fossil cat FILENAME" in that new
buffer to load the committed version, then doing ":diffthis" in each
buffer to get a side-by-side comparison.  Many features are available,
but usually I type "do" and "dp" to "obtain" and "push" changes between
the current and other buffer.

Another approach I've used when not using Fossil is to rename my changed
files to have ".new" or such at the end of the name, revert to the last
checked-in version, then pull changes from the ".new" one at a time,
testing and committing after each.

-- 
Andy Goth | <andrew.m.goth/at/gmail/dot/com>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to