New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Cola didn't properly read repository-wide(--local) config when it is launched from desktop icon(instead of in repository) #548

Closed
Vdragon opened this Issue Feb 4, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@Vdragon
Contributor

Vdragon commented Feb 4, 2016

Bug Reproducing Steps

NOTE: I haven't fully tested this yet, it may not work as expected. Try this in a brand new user account and Git repo if you don't want to overwrite your Git configs

  1. $ git config --global user.name A
    $ git config --global user.email A@example.org
  2. <under a Git repository> $ git config --local user.name B
    <under a Git repository> $ git config --local user.email B@example.org
  3. <**NOT** under a Git repository> $ git cola
  4. Select the same Git repository from the previous step in the prompt window
  5. Browse FilePreferences
  6. Switch between All repositories and Current repository tabs

Expected Behaviour

Under Current repository tab lists user.name=B and user.email=B@example.org

Current Behaviour

Under Current repository tab lists user.name=A and user.email=A@example.org

Other Information

  • According the trace it seems that Git Cola always read the global config instead of repo-wide config
  • The bug can't be reproduced when launched inside a Git repository

Reporter's Environment

Operating System

Ubuntu 15.10 AMD64

Git Cola

v2.5(Seems to be commit 9c2c2b3), self-built.

Git

2.5.0 from Ubuntu 15.10 software source

@Vdragon Vdragon added the bug label Feb 4, 2016

davvid added a commit to davvid/git-cola that referenced this issue Feb 4, 2016

models: consolidate behavior in set_worktree()
We must reset the gitcfg, chdir, and set attributes whenever the current
repo changes.  Consolidate this behavior into set_worktree so that the
other callers do not need to worry about these details.

This fixes an oversight where launching from a desktop icon would cause
cola to not see the repo's config.  Ensuring that both chdir() and
reset() are called ensures that the config is properly read.

Closes #548
Reported-by: V字龍 <Vdragon.Taiwan@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit to davvid/git-cola that referenced this issue Feb 4, 2016

models: consolidate behavior in set_worktree()
We must reset the gitcfg, chdir, and set attributes whenever the current
repo changes.  Consolidate this behavior into set_worktree so that the
other callers do not need to worry about these details.

This fixes an oversight where launching from a desktop icon would cause
cola to not see the repo's config.  Ensuring that both chdir() and
reset() are called ensures that the config is properly read.

Closes #548
Reported-by: V字龍 <Vdragon.Taiwan@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit to davvid/git-cola that referenced this issue Feb 4, 2016

models: consolidate behavior in set_worktree()
We must reset the gitcfg, chdir, and set attributes whenever the current
repo changes.  Consolidate this behavior into set_worktree so that the
other callers do not need to worry about these details.

This fixes an oversight where launching from a desktop icon would cause
cola to not see the repo's config.  Ensuring that both chdir() and
reset() are called ensures that the config is properly read.

Closes #548
Reported-by: V字龍 <Vdragon.Taiwan@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>

@davvid davvid closed this in #549 Feb 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment