Override committer for destination commit

37 views
Skip to first unread message

Kavita Golwalkar

unread,
Jan 10, 2024, 2:42:32 AM1/10/24
to Copybara OSS
Hi,

Copybara allows to override the authors.
Is there a way to override the committer as well ?

Adrià Vilanova Martínez

unread,
Jan 12, 2024, 6:28:07 AM1/12/24
to Copybara OSS
I think Copybara gets the committer info from your git config,[1] and you can use the --git-committer-email and --git-committer-name flags to override it.[2]

Mikel Alcon

unread,
Jan 12, 2024, 9:21:26 AM1/12/24
to Adrià Vilanova Martínez, Copybara OSS
Yes, the right way is to use --git-committer-email and
--git-committer-name. The reason we have them as flags instead of a
config value or even more dynamic, allowed to change it per commit, is
that the committer shouldn't really change per commit. That is why git
differentiates between author and commiter:
- Author: who created the change
- committer: How was in charge of putting the change in the repo.
In this case "copybara" or the current user running the workflow is
the best choice. Internally we use it like that, in the CLI, it uses
the current user that runs the migration. In the internal service we
have, we overwrite (or let overwrite per project) using those flags,
to mark that it was done in the service.

I hope it helps.
> --
> You received this message because you are subscribed to the Google Groups "Copybara OSS" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to copybara-discu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/copybara-discuss/3aa06e0c-bedd-4f07-a7cc-ac84cee46a6en%40googlegroups.com.

Kavita Golwalkar

unread,
Jan 15, 2024, 7:34:20 AM1/15/24
to Copybara OSS
Thanks . That helped.
Reply all
Reply to author
Forward
0 new messages