From 0fd8af4a9b3a70cb38aa628ebece64aa3f50d4d9 Mon Sep 17 00:00:00 2001 From: David James Date: Mon, 27 Sep 2010 10:04:57 -0700 Subject: [PATCH] Configure git author name and git author email in .gitconfig. If git author name is different in the chroot from outside the chroot, repo may auto-delete your changes when you run repo sync. These changes can be recovered, but their deletion is inconvenient. BUG=chromium-os:5934 TEST=Check that git var GIT_COMMITTER_IDENT is now correct inside chroot. Change-Id: I622cd37caa404a7482c55c4b3984877b32b3807c Review URL: http://codereview.chromium.org/3352008 --- enter_chroot.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/enter_chroot.sh b/enter_chroot.sh index a72e7ac287..5b412f4d6e 100755 --- a/enter_chroot.sh +++ b/enter_chroot.sh @@ -285,6 +285,12 @@ if [ -d "$HOME/.subversion" ]; then fi fi +# Configure committer username and email in chroot .gitconfig +git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all user.name \ + "$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/ *<.*//')" +git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all user.email \ + "$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/.*<\([^>]*\)>.*/\1/')" + # Run command or interactive shell. Also include the non-chrooted path to # the source trunk for scripts that may need to print it (e.g. # build_image.sh).