google / google/copybara

Set git author information from source commit instead of depending on local git config

Open
#164 1 comment 7 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.8k
Forks
345
PR merge metrics
No merged PRs in 30d

Description

Attaching copy.bara.sky file for reference:

```
core.workflow(
....

mode = "ITERATIVE",

authoring = authoring.pass_thru("username "),

transformations = [
metadata.restore_author("ORIGINAL_AUTHOR", search_all_changes = True),
],
)
```

Currently, we are restoring the original author of the commits. Even though the authors from the source commit is restored, the copybara is using the local git config author information set using `git config --global SETTING VALUE` as the commiter.

I could notice the same behaviour in copybara repo itself

![image](https://user-images.githubusercontent.com/4211715/108508461-dadc2280-72e1-11eb-9a53-f678f742bfb9.png)

Notice how the commits say
> Copybara Team authored and Copybara-Service committed yesterday

We would like to just retain the author information and avoid taking the local git user as commiter. For example, if that setting is enabled on copybara repository, the commits would say
> Copybara Team commited yesteday

When we tried to achieve this by avoiding to set git author information in local config, we get this error from copybara. (seems like it is needed for sure while running copybara)

![image](https://user-images.githubusercontent.com/4211715/108507415-4ae9a900-72e0-11eb-879d-c6e66eee03be.png)

So, is there a way to avoid setting committer information from local git config and use the source commit author instead?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.