Repos fail to commit with error "author field is required" when using git config includes for [user] section
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia riproducendo il passaggio di commit tramite il comando git-xargs, con user.name e user.email presenti solo nel ~/.gitconfig.local incluso, confrontando le ricerche di git config con e senza --includes. Esamina la gestione del commit e della configurazione Git, quindi verifica che vengano utilizzati i valori di identità inclusi e che git-xargs avverta quando non è possibile identificare l’autore.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
git-xargs version
git-xargs version v0.0.11
Describe the bug
Logs here. When running git-xargs, I get the error "author field is required" during the commit step. This seems to be true of any repo I try with git-xargs.
It looks related to my git config includes. I use a different email addresses for git at work and use includes to specify my user.name and user.email on different machines. My ~/.gitconfig contains:
# ~/.gitconfig
[include]
path = ~/.gitconfig.local
# no [user] section exists
and
# ~/.gitconfig.local
[user]
name = ...
email = ...
I've never had any issue with this before, but notice this in the git-config man pages. It implies that git-config might not honor includes in some cases and that you might have to include an explicit option.
--[no-]includes
Respect include.* directives in config files when looking up values.
Defaults to off when a specific file is given (e.g., using --file,
--global, etc) and on when searching all config files.
Just to make sure the includes are read properly by git:
$ git config --get user.name
Aaron D Borden
$ git config --global --get user.name
# exit 1
$ git config --global --includes --get user.name
Aaron D Borden
To Reproduce
Steps to reproduce the behavior:
- Move your
user.nameanduser.emailfrom your ~/.gitconfig, to ~/.gitconfig.local - Add an
[includes]section as above in ~/.gitconfig to include ~/.gitconfig.local - I'm using a script to generate templates for git-xargs, it looks similar to this:
git-xargs \
--branch-name tts-bot/update-templates \
--loglevel "${LOGLEVEL}" \
--repos "${template_dir}/repo_list" \
--skip-archived-repos \
--pull-request-title "${pull_request_title}" \
--pull-request-description "$(template pull_request_description)" \
--commit-message "$(template commit_message)" \
$(pwd)/bin/ci_update_templates.sh "${canonical_repository}" "${template_dir}/template_files"
repos file contains the single repo 18F/ghad.
Expected behavior
git-xargs respects the git config include and attributes the author correctly AND git-xargs warns when it cannot identify the author for the commit.
Screenshots
Logs https://gist.github.com/adborden/f0000d75107e1971940d48b58bc710be
Additional context
To work-around, I confirmed that you can set the user.name and user.email in the main config and git-xargs works as expected.
- Lingua principale
- Go
- Stelle
- 1.1k
- Fork
- 75
- Merge medio
- 22h 5m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di gruntwork-io/git-xargs
-
Able to change commit message depending on repo?Forse di nuovo libera @ZachGoldberg l’ha presa 429 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
gruntwork-io/git-xargs#175 · 1 assegnatario ·
-
provide an environment variable with the temp directory nameForse già presa @jeff350 l’ha presa 1025 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
gruntwork-io/git-xargs#146 · 3 commenti · 1 reazione ·
-
GITHUB_HOSTNAME is ignoredApertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
gruntwork-io/git-xargs#145 · 1 commento ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
gruntwork-io/git-xargs#144 · 4 reazioni ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
gruntwork-io/git-xargs#143 ·
Tutte le issue di gruntwork-io/git-xargs
Issue simili
-
BasicEventElement `messageBroker` is never returned on read (jsonb decoded into `sql.NullString`)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
eclipse-basyx/basyx-go-components#963 ·
I maintainer di solito rispondono entro 1 giorno
-
Area/Console Aspect/UI Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
wso2/agent-manager#2743 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno