Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes: >> On the other hand, for a file-scope static that is likely to stay as a >> non-API function but a local helper, it may not be worth it. > > Oh, do you think that `reset_head()` is likely to stay as non-API > function? I found myself in the need of repeating this tedious > unpack_trees() dance quite a few times over the past two years, and it is > *always* daunting because the API is *that* unintuitive. > > So I *do* hope that `reset_head()` will actually be moved to reset.[ch] > eventually, and callsites e.g. in `sequencer.c` will be converted from > calling `unpack_trees()` to calling `reset_head()` instead. As long as the public API function is well thought out, of course it is OK. Ideally, builtin/reset.c can detect when it is making a hard reset to HEAD and call that same function. Which may or may not mean you would also want to tell it to record ORIG_HEAD and remove MERGE_HEAD and others), perhaps with another bit in that flag word.