Why does repo command fail to find android.git.kernel.org and how do I get work around the failure if I cannot upgrade repo? - repo

This answer points to the new repo command. The repo command points to the old site in older versions of repo. I have a shared Ubuntu 16 system where I was hesitant to update the repo command. How can point repo to the migrated repo at https://android.googlesource.com?

repo is just a Python script which has the correct url in the version I have on Ubuntu 18. Thus, a simple workaround is to just modify the URL in your script.
The failure is apparently a result of repo looking for its own repository so it can report if your current version is out of date (maybe it is used for other things?). My newer version of repo sets the URL differently:
The script looks for an environment variable named REPO_URL which, if set, overrides the location. If the variable is set, the script just uses it.
If the variable is not set, the script sets REPO_URL = 'https://gerrit.googlesource.com/git-repo'

Related

How can I get access to the script of a Python package in Ubuntu?

I am using Ubuntu for a Python project and want to get access to the script of rasa_nlu.evaluate so that I can better understand it and call the function within it with the appropriate arguments.
I am using the 0.11.5 versio of rasa_nlu. I tried to go in the usr/bin/ directory but cannot seem to be able to go any further. When I try cd /python on the Ubuntu shell, I get "No such file or directory".
Alternatively, can I find the code on GitHub? (it seems that I can only find the code of the 12.0 version of rasa...).
source for rasa_nlu is hosted on GitHub: https://github.com/RasaHQ/rasa_nlu
you can clone the repo with Git, or view the evaluate.py source right from GitHub in your browser
current master branch: https://github.com/RasaHQ/rasa_nlu/blob/master/rasa_nlu/evaluate.py
11.5 version: https://github.com/RasaHQ/rasa_nlu/blob/0.11.5/rasa_nlu/evaluate.py

How to use specific repo tool version

I installed repo on my system, but why can't I see its version using 'repo --version' until 'repo init' is run!
Also to suppress repo init to connect to android repo git, I have to pass --repo-url. Is it possible to suppress this behaviour, because it forces me to use repo version from --repo-url and not the one I installed??
In order to ensure you use the newest version (or for compatibility), when you run repo init, repo tool will download a new version of repo in your .repo/repo. So by default, repo --version is designed to check the version in your .repo/repo.
If you want to avoid using --repo-url, you can download repo source and add the directory of repo source to your PATH environment variable.

Changing the location of git installation on linux

I apologize if this seems basic but I'm new to linux and not really sure how to proceed. My current git version is 1.7.1 and is located in /usr/bin/git but a newer version of git (1.8) is now available in /usr/src/git/bin/git. How do I make git use this version by default as opposed to the 1.7.1 version?
You have to make sure to call the right executable. This can ben done by explicitly calling /usr/src/git/bin/git instead of git. Of course this would be annoying to type all the time, so you can either make git an alias for that path by adding the line
alias git=/usr/src/git/bin/git
to your .bashrc, or add the directory /usr/src/git/bin to your binary search path by adding the line
export PATH="/usr/src/git/bin:$PATH"
To test that the other git installation searches for the core binaries in the right place, you can check the output of git --exec-path.

grunt-init not creating any file(s)

I probably missed something here. I'm using Node 0.10.1 on Win7/64bit and installed grunt 0.4.1 with
npm install grunt
npm install -g grunt-cli
npm install -g grunt-init
Then I tried to install a template while in folder %USERPROFILE%
git clone git#github.com:gruntjs/grunt-init-gruntfile.git ~/.grunt-init/gruntfile
But git wants a passphrase for key [current folder]. So I just created a folder
%USERPROFILE%\.grunt-init\gruntfile\
and copied
https://raw.github.com/gruntjs/grunt-init-gruntfile/master/template.js
to it. Now I switched to the project folder and was able to start grunt-init with
grunt-init gruntfile
DOM involved? n
files concatenated or minified? Y
package.json? n
any changes? N
Process ends with "Done, without errors", but no file ist created, or at least I can't find it.
dont know how to clone into your userhome on windows, but IMPORTANT(!) you also need to copy the whole "root" directory ( https://raw.github.com/gruntjs/grunt-init-gruntfile/master/root) to '%USERPROFILE%.grunt-init\gruntfile\'
you know that this init-template will just create a gruntfile.js for you? (inside the root-directory you can see that). if you want to create a node-module, jquery-plugin and so on, use one of the other templates (grunt-init-node, grunt-init-jquery) and so on.
creating your own template is easy. just create a new folder in '%USERPROFILE%.grunt-init' with your template-name. add the template.js. add a root-directory where all the files are which you want to be copied, maybe add a rename.json (for folder and file-renamings) and maybe change some stuff in the template.js.
I think you are have few a different issues here - from your comments it looks like you are using a Windows.
The first issue is that you can't clone the repository. Having tried this myself, I found the problem was fixed by setting up a valid ssh key on my github account. So to clone this repository you need to create a github account and install ssh keys on both your machine and your github account. Github's documentation on how to do this is very good and can be found here for Windows https://help.github.com/articles/set-up-git#platform-windows.
The second issue is that the git clone command you are using won't work on a Windows machine as it supplies a path to a Linux home directory ~/.grunt-init/gruntfile.
From your comments I am guessing the %USERPROFILE%.grunt-init\gruntfile\ is the correct install directory for Windows and so changing your working directory to that and using the command git clone git#github.com:gruntjs/grunt-init-gruntfile.git should install it.
You may also consider working using Cygwin which allows you to use a linux working environment on a windows machine.
Happy node hacking.

gitolite hook for specific repository

I don't understand how do I create a post-receive hook for a specific repository in gitolite (non-root install)
My bare repository contains a website that should copy the working directory to the docRoot
(GIT_WORK_TREE=/path/htdocs git checkout -f) on update
Before gitolite, I would just update the hook for the specific repository.
Gitolite documentation mentions that all hooks should be at hooks/common so I don't understand how it works.
What should be the name of hooks, where it should be located and how it's structure should be changed (if it should)?
Update July 2013: what follows is for gitolite V2 (or 'g2'), which was the version used by the OP at the time (November 2011).
Update August 2013, with the latest gitolite 3.x:
You now have official specific repo hook:
it's basically just creating a symlink in <repo.git>/hooks pointing to some file inside $rc{LOCAL_CODE}/hooks/repo-specific (except the gitolite-admin repo)
All hooks in gitolite/hooks/common are replicated in all repositories managed by Gitolite, as detailed in the hook propagation documentation.
That means your hook script must take specific action depending on the repo which execute said hook.
You can either use the $GL_REPO variable (which gitolite set and pass to all its scripts for any git command it receives).
Or you can use some git configuration registered on the gitolite server, like the mirroring hook does. See the post-receive.mirrorpush hook.
The OP Eyal R adds in the comments:
But I still don't understand how it is done (I understand that $GL_REPO is used to determine which repo I am updating but I'm missing the practical part).
I have created a file called post-receive.test with echo "test", put it in $HOME/gitolite/hooks/common, ran gl-setup, ran push from workstation - nothing happens (no "test" output)
To which I replied:
The hook should appear in the hook directory of your repo on the gitolite server as a link, linking back to the .gitolite/common/hook. Note that it should be in $HOME/.gitolite/common/hook, not /gitolite.
The OP confirms the missing dot was the issue.
The process to add an hook is detailed in Hook propagation in gitolite, and their usage in "Using Hooks".
This is a fairly common need for someone using gitolite, and appears to be a little difficult to tie up loose ends when being not a very advanced user (at leas it was for me).
Following stackoverflow's and gitolite's links back and forth can be a little confusing. These are my conclusions and the path I followed to be able to achieve this.
As #VonC mentioned creating repository specific hooks is already possible since version 3.5.3.1 (github link)
Update/Upgrade Gitolite
The first thing you should do is update your gitolite repo. So ssh into your server that is hosting gitolite and move to the location where gitolite is installed (usually /home/git/gitolite) as the git user (usually git)
Example:
$ ssh myusername#devserver.com
$ sudo su - git
$ pwd
/home/git
$ cd gitolite
Then we have to upgrade gitolite. To do so, first we need to update the gitolite repository
$ git pull
Then we have to repeat the install command (make sure you use the same arguments as before)
$ ./install
And finally run the setup again.
$ gitolite setup
If that doesn't work, you probably haven't set up gitolite executable in your PATH, so you could do something like this:
$ src/gitolite setup
Gitolite Settings (The "RC" file)
This was one of the parts that confused me the most, but it ended up it was pretty straight forward.
The famous "rc" file is located at git's home directory /home/git/.gitolite.rc. There make sure you have a variable called LOCAL_CODE, you should see something like this on that file, if not, add it.
LOCAL_CODE => "$ENV{HOME}/.gitolite/local"
And in the "commands an feature to enable" section you should make sure that repo-specific-hooks is available, if not, add it.
ENABLE => [
# COMMANDS
# These are the commands enabled by default
'help',
'desc',
'info',
...,
...,
...,
'repo-specific-hooks'
...,
...,
...
]
Here is the link to the documentation
Writing Repository Specific Hooks
Finally, in your local gitolite-admin repository create the following directories hooks/repo-specific under the directory you just set in the LOCAL_CODE variable, for example:
gitolite_admin/local/hooks/repo-specific
After that you can actually add your hooks scripts to that location and manage them through the gitolite conf file as stated in the documentation. Make sure the scripts are executable.
repo foo
RW+ = #all
option hook.post-receive = deploy
Again, I hope this helps some of you guys.
Cheers!

Resources