Skip to content
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

Remove dubious ownership error with docker image #106

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nathanaelhoun
Copy link

When using docker, instruct the (human) user to run the docker image with the current (unix) user.

Fixes the "fatal: detected dubious ownership in repository at '/repo'" error message.
Fixes #81 (I prefer changing the docker run command than modifying the docker image)

Before:

[nathanael@laptop:/tmp/tmp.Yesz1KNOwJ]$ docker run --rm -v "$(pwd):/repo" casperdcl/git-fame
fatal: detected dubious ownership in repository at '/repo'
To add an exception for this directory, call:

	git config --global --add safe.directory /repo
Processing: 100%|██████████| 1/1 [00:00<00:00, 714.17file/s]
error: too many arguments given outside repository
usage: git shortlog [<options>] [<revision-range>] [[--] <path>...]
   or: git log --pretty=short | git shortlog [<options>]

    -c, --[no-]committer  group by committer rather than author
    -n, --[no-]numbered   sort output according to the number of commits per author
    -s, --[no-]summary    suppress commit descriptions, only provides commit count
    -e, --[no-]email      show the email address of each author
    -w[<w>[,<i1>[,<i2>]]] linewrap output
    --[no-]group <field>  group by field

Total
| Author   | loc   | coms   | fils   |  distribution   |
|----------|-------|--------|--------|-----------------|

After:

[nathanael@laptop:/tmp/tmp.Yesz1KNOwJ]$ docker run --rm -v "$(pwd):/repo" --user "$(id --user)" casperdcl/git-fame
Processing: 100%|██████████| 2/2 [00:00<00:00, 374.71file/s]
Total commits: 1
Total ctimes: 1
Total files: 2
Total loc: 2
| Author         |   loc |   coms |   fils |  distribution    |
|:---------------|------:|-------:|-------:|:-----------------|
| Nathanaël Houn |     2 |      1 |      2 | 100.0/ 100/100.0 |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Dubious ownership in repository" error running Docker container
1 participant