How to list active projects in gerrit - gerrit

We have totally 1k gerrit projects, In that many are Active, ReadOnly and Hidden. I'm the gerrit admin and would need to list the projects are in Active state.
How do i list only the active project in gerrit?
I couldn't find state oriented option in this - Link
Please let me know the way to list them. Thanks in advance.

This Link has an answer.
With ssh -p 29418 your.gerrit.host gerrit ls-projects -h to list help options then need to look for below section.
--state (-s) [ACTIVE | READ_ONLY | : filter by project state
HIDDEN]
With the --state able to list the active only projects.

Related

How can I search commit message in BitBucket

How can I search the commit message in BitBucket? I can only search the codes but that doesn't help me. I want to find the keyword HDMI in the commit title for example.
There is a search box for commits on the Bitbucket webpage, under Commits.
If you are using source tree its easy :-)
In the new versions:
If you also have the project locally, you can also search for the log via the console. Don't forget to do a git pull first, to be on the same level as remote.
git log --oneline | grep PATTERN
To search specifically on the commits message you can use the aforementioned search box of the BitBucket page and use the operator 'keyword(string)' or 'grep(regex)'

How to set username and password for SVN repository in Xcode ?

I'm new to SVN when committing the code to svn repository it was not asking username and password and it will raise issue showing author name was empty in repository commit history. How could set for username every time while committing the code to svn repository in Xcode ?
You should be able to run svn info <REPOSITORY-URL> -username <USERNAME> and the <USERNAME> will be specified as svn:author for your commits.
The actual problem is that your server allows anonymous and non-authenticated access. I guess that your admin may want to reconsider that and make the server require authentication or at least reject commits with empty svn:author property. Users should not be able to enter arbitrary usernames / commit author names. How are you going to distinguish was an author of some revision in future? How are you going to search repository history for commits made by a particular user if this user can enter anything he wants as his username?

How to assign access rights to a Gerrit project using API / SSH?

I'm looking for a way to automatically add +2 permissions for certain refs for a lot of projects in Gerrit and unfortunately it seems there are no API calls to modify access rights, only to read them. Do you have any idea how to modify refs permissions for a big amount of projects?
I'm using Gerrit 2.9.
Thanks.
One possibility would be to create a batch script to modify the project.config for those projects and commit them back to gerrit.
This is how you can checkout the project.config for the All-Projects, it works the same for other projects: http://blog.bruin.sg/2013/04/how-to-edit-the-project-config-for-all-projects-in-gerrit/
Simply put:
Create list of project you want to change
Iterate over the lest
Checkout the refs/meta/config ref
Use script to modify project.config
Commit and push back to the server
More information about the project.config: http://gerrit-review.googlesource.com/Documentation/config-project-config.html

TFS 2013 restrict tag from list?

When user adds tag, is there a way to force him to select one of "proposed list" ? I would something just like this site has, must select tag but only from the list it proposes you.
In case not, is there a way to add a control which will disable him from the saving the WIT?
If you have TFS 2013.3 you can restrict permission to create tags. That should give you the feature that you want. If you go, in web access, to Settings | Permissions | Create Tag Definition.

How to work with two different BitBucket accounts in SourceTree

I have two different bitbucket accounts set up. One is for work projects and one is for personal use. In BitBucket I have set up a repository in each of the accounts for different projects.
In SourceTree I have a few existing personal projects that are syncing up to my personal repository on SourceTree. In the left hand panel I can see my "Develop" branch for one of those personal projects and on the remote in BitBucket I can see the remote repo.
In SourceTree I don't see an obvious way to keep my two accounts separate. For example, I have added the work repo in SourceTree but when I try to commit an initial version of a work project it only gives me the option to commit my personal project branch.
How can I now add my work repo locally and sync only those work projects into repos on that work BitBucket account?
For SourceTree 2.0.2+ on Mac only with GitHub accounts:
Click from menu File-> New/Clone
In the dialog click settings icon.
In the resulting popup menu click Settings
It brings a dialog with listing user accounts. Add your additional account to the list.
Close the dialog.
Click remote button (next to local) on the tool in image shown below.
All your added accounts will be listed and their respective repositories with button to clone.
Hope this helps.
NOW on Windows, you do it in the Clone/Add/Create Repository dialog:
Click the "Hosted Repositories" button (internet icon)
Click "Edit Accounts"
Click "Add"
Well I have done this way:
Click on Settings
Click on Advance tab
Enter your Full name and Email address (Email should be match with your Bitbucket account)
Click on OK
Click on Close (To close current window)
Restart again
Note: You must have added account in Source tree. (Open Source tree -> Click on Setting icon < Right Top corner> -> Click Settings -> Add your Account -> Set as Default account)
Hope this would help you.
In Windows, you can do it by following steps:
Click on settings button ( right top corner). It will open dialog box.
Click on Advanced tab.
Uncheck the "Use global user settings".
Now you can enter username and email id for corresponding repository.
Click on OK to save changes.
If I understand your question correctly, you still need to do a little bit more set of your bitBucket accounts.
You can also test the BitBucket server to see which account you are logging in with.
ssh -v git#bitbucket.org
This link help me, follow these instructions here and you should be successful.
The key part you need is in you .git/config.
You'll need separate entries for each.
Use different SSH keys for different accounts on the same Git hosting
In Windows you may have more than one account (you can have even GitHub and BitBucket side by side). For example, assuming the account you have now in SourceTree is with BitBucket and you want to add your GitHub account to it as well, do the following:
From menu, choose File->New/Clone
In the Source Path/URL put the repository url for a repository you have on github
Wait for a few seconds and it asks you for username/password. (first, buttons might be disabled for example for entering your password. So wait for a few seconds first)
Add the new username and passowrd on github.
Now if you like you can cancel the clone.
For BitBucket account/repos, you can include the username you want to use as part of the git URL. SourceTree will then ask for the password for that username.
https://username#bitbucket.org/account/repo
If you've already cloned a repository with ssh on the Mac version, and you want to change the account for it, you can do this by changing the host name of the remote.
If you've let SourceTree modify your ˜/.ssh/config , then it will have added some entries starting with:
# --- Sourcetree Generated ---
Host <account name>-<service name>
...
Choose the <account name>-<service name> combination that you want to use and modify the path of your repository (in Remote Settings). Your new path will be something like the following format:
git#<account name>-<service name>:<account name>/<repository name>.git
(Actually, you can use this solution for working copies not cloned by SourceTree too.)
on windows the tool has a bug
no matter what I've tried from within the tool it was always using a previews git account which was cached somewhere...
so I searched all files where sourcetree was installed and I found a file C:\Users\WIDNOWS_USER\AppData\Local\Atlassian\SourceTree\userhosts
there I had cached the old git user/account name and it was driving me nuts in the app.
I updated this file, deleted the old account name and added the new one, restarted the tool and it started to work fine.
there's also a file
C:\Users\WIDNOWS_USER\AppData\Local\Atlassian\SourceTree\passwd
check that one too and if your cached account with passwd is there too clean it out, do not add here anything, the app will do it first time when you enter your password for the new acccount

Resources