#Thread

1 messages · Page 1 of 1 (latest)

stiff mango
#

I see my own user. Assuming we use git config --list info

#

Though I don't see git info with
container-use config show

Base Image:             ubuntu:24.04
Workdir:                /workdir
Setup Commands:         (none)
Install Commands:       (none)
Environment Variables:  (none)
Secrets:                (none)
#

@wind knoll could you share what user you're seeing instead? Might help unravel the mystery.

lavish rapids
#

We don’t grab git info from anywhere, we just call your git cli without any additional configuration and it loads its own

stiff mango
lavish rapids
#

No, you can’t— cu uses git on the host machine, not inside environments

lavish rapids
stiff mango
#

Was just surprised that the user was seeing commits from cu from a different user.

lavish rapids
#

@wind knoll do you do anything “special” with user space file organization or git on this machine? Like having your home directory as a repo? Does your ~/.gitconfig have your desired user in it?

lavish rapids
#

or maybe your ~/.config directory is a git repository (with it's own config)

stiff mango
#

@wind knoll likely you don't have a global git config set up.
If you run

git config --list --global

vs

git config --list

do you see different results for these?

user.email
user.name
#

Actually

git config --list --show-origin

will show where all of the settings come from.

Maybe the repo you're working on has a .env file or something that sets this

#

Also, it seems that if you set user.name or user.email multiple times, the last instance will win. So in my case I did a
git config user.name "Temp User"
on top of my exisiting config, resulting in two entries.

git config --list --show-origin | grep user.name

file:/Users/jeremyadams/.gitconfig    user.name=Jeremy Adams
file:.git/config    user.name=Temp User

But only one wins:

git config user.name                                     
Temp User
wind knoll
#

Oh Wow, I'm a bit embarassed, but you nailed it! I do have different .gitconfig files for the different directories on my laptop where I have my projects and usually one of them would win. But the container is not run from one of these directories and so it uses the global config, that actually has the Temp User. Ups 🫢 Anyway, thanks so much for helping out!

lavish rapids
#

@wind knoll you mind opening a GitHub issue now that we understand what’s going on here? We should probably actually be respecting/copying repo-specific git config when we “fork” for container-use.

marble veldt
#

@wind knoll I was experiencing the same issue! Thanks for bringing this up - would you mind sharing the link to the issue?