Re: [PATCH 2/3] [Outreachy] ident: introduce set_fallback_ident() function
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 2, 2018, 05:22 UTC
- Message-ID
- <xmqqtvl0oxy2.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <xmqqh8h0qefq.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
> As we currently have no idea when builtin/stash.c becomes ready for > 'next', how about doing something like this instead, in order to > help end-users without waiting in the meantime? The fix can be > picked up and ported when the C rewrite is updated, of course.
I think a better approach to fix the current C version, assuming that a reroll won't change the structure of the code too much and keeps using commit_tree() to synthesize the stash entries, would be to teach commit_tree() -> commit_tree_extended() codepath to take commiter identity just like it takes author identity. Then inside builtin/stash.c, we can choose what committer and author identity to pass without having commit_tree_extended() ask for identity with the STRICT option. Right now, commit_tree() does not have a good way, other than somehow lying to git_author/committer_info(), to record a commit created under an arbitrary identity, which would be fixed with such an approach and will help callers with similar needs in the future.