gitolite can't add keys to authorized_keys when pushing - cygwin

cloning gitolite-admin to my workstation and managing users and repo, but when pushing, I got some errors like this:
remote: Initialized empty Git repository in /home/git/repositories/fmame.git/
remote: /bin/find: paths must precede expression
remote: Usage: /bin/find [path...] [expression]
remote: /bin/find: paths must precede expression
remote: Usage: /bin/find [path...] [expression]
remote: /bin/find: paths must precede expression
remote: Usage: /bin/find [path...] [expression]
remote: /bin/find: paths must precede expression
remote: Usage: /bin/find [path...] [expression]
remote: /bin/find: paths must precede expression
remote: Usage: /bin/find [path...] [expression]
To git#localhost:gitolite-admin
here is my steps:
1/ editing gitolite.conf:
repo gitolite-admin
RW+ = gitoliteadm
repo testing
RW+ = #all
repo mfame
RW+ = ryoma
2/ puts ryoma.pub in keydir directory.
and I have my work running on windows 7 within cygwin.
How would you modify this setup in order to allow me cloning the gitolite-admin repo?

Following "Gitolite hook doesn't work", make sure your sshd (ssh daemon running on your gitolite server) has a proper PATH.
That (improper PATH) could causes the "remote: /bin/find: paths must precede expression" error message, because in might select the wrong shell.

Related

What does ... mean in file path in linux(ubuntu) or git

When I ran the command git pull all updated files are shown and their paths are relative to .git file.
But due to some reason I am seeing ... in file path. Am I am unable to do to the path as linux has . and .. according to my knowledge which represents current and previous directory resp.
Attaching my output
$ git pull
remote: Enumerating objects: 72, done.
remote: Counting objects: 100% (72/72), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 43 (delta 28), reused 7 (delta 4), pack-reused 0
Unpacking objects: 100% (43/43), done.
From ssh://gitlab-master.xyz.com:12051/projectx/santor
234243..434323 master -> origin/master
989894..324342 branch-xyz -> origin/branch-xyz
Updating 480026d82..e87fa34343
Fast-forward
.../modules/files/text/jump/jumps.yaml | 3476 +++++++++++++++++++++++++++++++++++++++++++++++
.../modules/files/text/drink/jumps.yaml | 228 +++-
It doesn't have a general specified meaning. This is just a way for Git to display an abbreviated path when the whole thing would break screen formatting.
It doesn't mean anything in the file path.
It does mean something in the Git output: that Git isn't printing part of the path.
When Git produces git diff --stat output like this, it needs to print various file names, but it has a limited amount of columnar space in which to print them. So it uses compression tricks. One of these is to leave out parts of the pathname, representing the left-out part with .... That is what you are seeing here.

How to git ls-tree from a commit object?

From documentation, in order to use git ls-tree you need to pass the hash of a tree object. What if I want to obtain the same output of git ls-tree starting from a commit object.
I can obviously do it with something like this:
git ls-tree $(git cat-file -p my_commit | grep -oP "(?<=tree ).*")
But I feel like I am reinventing the wheel. Is there a git command that already does this?
No, git ls-tree takes a tree-ish object.
The "-ish" suffix here is important. Per the Cambridge Dictionary:
-ish suffix (QUITE)
used to form adjectives to give the meaning to some degree; fairly:
He had a sort of reddish beard.
She was oldish - about 60, I'd say.
We'll start at sevenish (= about seven o'clock).
In this case, "tree-ish" means like a tree. A tree, of course, is like a tree. But a commit is also like a tree since it has exactly one tree component; that means that you can unambiguously refer to that tree by simply using the commit itself.
So, just do git ls-tree <commit-ish>.

how to use "--no-ff --no-commit" using GitPython while merging?

When i use commandline git merge with --no-ff --no-commit works fine. But using GitPython i am unable to dos.
May be i am not finding a correct documentation or forums for the below equivalent operation using GitPython.
Am i missing any ?
command line:
git merge --no-ff --no-commit "<TAG Name> or <Feature branch>"
GitPython:
print(f"Merging from tag '{input_tag}' into 'master'...")
repo = Repo(constants.git_clone_local_path)
repo.git.checkout('master')
repo.git.pull()
repo.git.merge(f'--no-ff --no-commit {input_tag}')
# repo.git.merge(f'{input_tag}', no_ff=True)
print(repo.git.status())
print('Done')
Python gives below error
cmdline: git merge --no-ff --no-commit test_tag
stderr: 'error: unknown option `no-ff --no-commit test_tag'
usage: git merge [<options>] [<commit>...]
or: git merge --abort
or: git merge --continue
-n do not show a diffstat at the end of the merge
--stat show a diffstat at the end of the merge
--summary (synonym to --stat)
--log[=<n>] add (at most <n>) entries from shortlog to merge commit message
--squash create a single commit instead of doing a merge
--commit perform a commit if the merge succeeds (default)
-e, --edit edit message before committing
--cleanup <mode> how to strip spaces and #comments from message
--ff allow fast-forward (default)
--ff-only abort if fast-forward is not possible
--rerere-autoupdate update the index with reused conflict resolution if possible
--verify-signatures verify that the named commit has a valid GPG signature
-s, --strategy <strategy>
merge strategy to use
-X, --strategy-option <option=value>
option for selected merge strategy
-m, --message <message>
merge commit message (for a non-fast-forward merge)
-F, --file <path> read message from file
-v, --verbose be more verbose
-q, --quiet be more quiet
--abort abort the current in-progress merge
--quit --abort but leave index and working tree alone
--continue continue the current in-progress merge
--allow-unrelated-histories
allow merging unrelated histories
--progress force progress reporting
-S, --gpg-sign[=<key-id>]
GPG sign commit
--overwrite-ignore update ignored files (default)
--signoff add Signed-off-by:
--verify verify commit-msg hook
This should work
git.merge('args', no_ff=True)
replace 'args' by yours arguments like your branch...
I didn't find any links in the documentation. But this code worked for me.
repo = Repo(constants.git_clone_local_path)
repo.git.merge(<source_branch>, no_ff=True, no_commit=True)

git command to show branch/feature name from a sha1 hash

How do I get the branch/feature name from a sha1 hash on the command line?
Also how is this done using pretty=format syntax.
I see that it's done somehow using this method
git log --graph --full-history --all --color \
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
but I don't know which line is causing this.
How do I get the branch/feature name from a sha1 hash on the command line?
You can use...
git branch --contains <sha1>

How do I get the effect of GNU tar's --strip-components with git-archive?

In broad terms, what I'd like is a direct tar-to-tar transformation where the result's root contains only a particular directory-subtree of the original.
To illustrate with an example, say I want only the gitweb directory from git's repository. Running
$ git archive --prefix=git-gitweb/ master gitweb | tar tf -
gives
git-gitweb/
git-gitweb/gitweb/
git-gitweb/gitweb/INSTALL
git-gitweb/gitweb/Makefile
git-gitweb/gitweb/README
git-gitweb/gitweb/gitweb.perl
git-gitweb/gitweb/static/
git-gitweb/gitweb/static/git-favicon.png
git-gitweb/gitweb/static/git-logo.png
git-gitweb/gitweb/static/gitweb.css
git-gitweb/gitweb/static/gitweb.js
but I want
git-gitweb/
git-gitweb/INSTALL
git-gitweb/Makefile
git-gitweb/...
The manual provides for extra backend-specific options, but attempting to pass --strip-components produces an error:
$ git archive --prefix=git-gitweb/ --strip-components=1 master gitweb | \
tar tf -
error: unknown option `strip-components=1'
usage: git archive [options] [...] ...
The tar backend isn't GNU tar anyway.
Someone in freenode's #gnu channel suggested Tardy, but it doesn't understand the output of git-archive:
$ git archive master > old.tar
$ tardy old.tar new.tar
tardy: old.tar: file type ``g'' unknown
Yes, I could extract the output of git-archive with --strip-components and create a new archive of the result, but I'm trying to avoid using the filesystem as a temporary variable.
Archive that directory as the CWD and you won't have the extra path component:
(cd gitweb; git archive --prefix=git-gitweb/ master .) | tar tf -
Or use this syntax as suggested by the git-archive man page:
git archive --prefix=git-gitweb/ master:gitweb | tar tf -

Resources