How to hide some compiled files from showing up in gerrit review - gerrit

I have a project where many files like package-lock and other compiled file pollute the to-review file list. I don't want move them out of git as they significantly reduce install and run time. Is there a way to tell Gerrit to not show these files?

No, so far (Gerrit 3.2.3) there's no way to hide these files.
As you probably know, it's not a good idea to store binary files in Git so you could try to use the Git LFS feature of the Gerrit lfs plugin

Related

git-tfs clone and cleanup

I have cloned my TFVC from VSTS and it pulled all my branches without any errors. I then followed a number of online posts that said to cleanup my projects by doing the following:
Remove the GlobalSection(TeamFundationVersionControl) section from solution files
remove all *.vssscc files
Remove all *.vspscc files
When I do this I get almost all of my files showing up in the Changes window under Team Explorer. All of these files have no changes when doing a diff except for the files discussed earlier.
What is the proper way to cleanup branches after doing the clone from TFVC to git?
Thanks
If you want to migrate an existing TFVC repos to Git repos, you can use the git-tfs tool, which allows you to migrate a TFVC repo to a Git repo in just a couple of commands.
In my example, with the commands below, I have successfully migrated an existing TFVC repo to Git repo with all branches.
If you don't want to clone the branches, you can specify --branches=VALUE (VALUE=none|auto|all), check https://github.com/git-tfs/git-tfs/blob/master/doc/commands/clone.md
When I do this I get almost all of my files showing up in the Changes window under Team Explorer. All of these files have no changes when doing a diff
That should be due to a bad end of line setting...
except for the files discussed earlier.
First commit them...
Then fix your setting.
You've got 2 options (not mutualy exclusive, you could do the 2. But if you do only one, do the 2nd) :
(old style), set the git core.autocrlf setting. On windows, that's either true to convert all file to a windows eol style or false to tell git to not touch the files. It's a matter of choice. This settings will be used for ALL your repositories but will be personal
(new one recommended) Add a .gitattributes files to telle git how to handle eol for all type of files. This settings will be used for this repository only but will be shared by all the developpers and noone won't be able to commit bad files.
Be aware that for all the strategies that you will try, to be sure that it works, you will have to do soemthing special. You will have to wipe all the files and checkout them all from the repository (because that's at this special moment that git modify the files):
git checkout .
There is a possibility that in fact, the files are modified because they have been checkouted in the format you wish, so commmit them all (you will be obliged) and apply the eol strategy, just after...
A good doc on the subject that you should read carefully and understand before trying something...
PS: handling end of line is not an easy task in a git repository and it will take you quite some time and you will have to try a lot of things before really understanding how it works ( I'm not pretty sure myself ;) )

Delphi SVN cleanup

I am trying to provide a lot of context below for this problem so that experienced people can read the symptoms. I expect more questions will need answering to get to the bottom of it.
The short form of this question is how do I remove the source control history from a project in Delphi? (The local project folder) After removing the .svn and .local directories Delphi still wont svn import. There is nothing in the repository. This seems to be a problem with the Delphi integration. Some local caching of activity that does not seem to be relying on the repository for information.
Longer form: I recently setup the Delphi XE3 included subversion client and server. It is running as a service on Windows. The setup was done with sc as per the svn-book.
I successfully figured it all out by trial and error. With a fair bit of error over the last few days.
In trying to clean up my source code and repositories to get to a clean install I found that I needed to remove repositories from the server and re-create them. I also thought if I removed the .svn directories from the source that it would remove all traces of source control. This did not work. So I tried to additionally remove the .local files, which do have some version history in them.
When I load the project group and switch to the import tab, I still see recent comments showing my initial commit.
In addition when I try to Import a dialog comes up saying one of my big key .pas files is already under version control. Another file, a dproj file it says is not under version control. When I check the repo with
svn ls
some folders got made, but there are no files in the repository.
The config file is setup such that I should need to supply a password. It never asks for one. I just left the default security in place because I dont need to concern myself with it much. Just enough to stop mistakes. It is on a local network. SVN Import didnt require it either.
I can manually add files with svn import. I am using the svn: protocol prefix with svnserve.exe running as a service. Authentication is default. It works without passwords for some reason. It shouldnt do that.
svnserve.conf has the following: (comments omitted for bevity)
[general]
anon-access = none
auth-access = write
password-db = D:\SVNRepos\conf\passwd
realm = Root
force-username-case = none
svn --Version says:
svn, version 1.7.5 (r1336830)
compiled May 11 2012, 02:21:17
At first, SVN is not CVS. While CVS is legacy system with many problems, SVN is a modern centralized version-control system (git fans may disagree, but this is another topic).
Subversion 1.7 is out of date and no longer supported. The current release is Subversion 1.9 and it has many improvements compared with 1.7. SVN 1.8 is still supported as well. Therefore, you should definitely upgrade your client and server to the latest version.
Returning to your problem: you haven't specified any errors that you get in Delphi XE3 IDE. Do you get any?
When you svn add files in Subversion working copy, you schedule them to be committed next time you run svn commit. So there is a chance that you haven't actually committed them to the repository.
If your code was already imported to Subversion repository, then it has to be there. Double-check this with svn ls -r <URL> again. Then you could checkout a working copy using svn checkout <URL>.
BTW, .local files do not relate to Subversion. These seem to be some project files of the IDE, but I'm not sure.
And if you have issues with Subversion server setup on Windows, there are packages that should help you. See the binary packages page.

How can I push to bitbucket.org without my project parent directory

I had created a remote repo with bitbucket.org, for example, https://somebody#bitbucket.org/somebody/test.git
When I pushed my local repo to the bitbucket repo by Eclipse EGit, I got all my project files in a parent directory, for example, https://somebody#bitbucket.org/somebody/test.git/Test/XXX. But I only hoped all my project files located in the repo root, for example, https://somebody#bitbucket.org/somebody/test.git/XXXX.
How can I do? Thanks!
eGit converts eclipse project into a folder under your Git repo when you 'share' it. This is the way eGit works, so I don't think what you asking is possible with eGit.
It is better this way IMO because such design allows for several projects in the same Git repository, which is very common.

Git not recognizing rails plugin

I installed the table_builder plugin from https://github.com/p8/table_builder, followed the directions at the bottom titled For a pre rails 3.0 table_builder: which works great.
The problem is since I checked out a branch of it, when I try to commit this to MY GIT repo, it doesnt think there are files even there.. git status diplays nothing, git add wont add the files..
Any suggestions as to how I can get this committed?
Maybe you cloned the plugin directly into your own repository and you now have the plugin repository within your repository?
A git repository will by default ignore any other repositories and their working directories that are located within it.
If so, you have (at least) two options:
Clone the plugin elsewhere, and then
copy the necessary files into your
repository
Clone the plugin into your repository
and then delete the plugin's .git
folder
There are other ways to manage this with git-submodule but I'm not an expert on that so I defer to someone with more knowledge.
Check the .gitignore file in your project root folder. If git status doesn't see the files and git add won't add them, it's most likely because they're being specifically ignored.

What should I do with the vendor directory with respect to subversion?

So I have a problem. I checked in my frozen gems and rails even though you aren't supposed to do that. I figured it was easy and wouldn't be that big of a deal anyway. Well, later I updated rails and in doing so deleted all the .svn files in the vendor/rails directories. I have heard that what I really should do is just do something to do with svn:externals to my vendor directory. What exactly do I need to do and will capistrano still use my frozen gems if they aren't in my repo? If it will not use my frozen gems how can I regenerate those .svn files correctly, because this will happen again.
Thanks!
Personally, I'm partial to using Piston to manage the vendor directory.
To recover your deleted .svn directories, just run an svn update. They'll come back.
I just check in exported gems. I use gem unpack <gemname> in the vendor/gems directory and svn add and commit from there.
Anything in vendor/plugins or vendor/rails I track using piston. For example, this is how I get rails in there:
% piston import http://dev.rubyonrails.org/svn/rails/tags/rel_2-0-2/ vendor/rails
To get piston use gem install piston.
Note I'm going to have to find a different/better solution to replace piston as Rails continues to use git and may not update the subversion repository.
I'd have to advise against svn:externals for two reasons
you might be deploying into an environment that cannot reach those svn services
what happens when you want to deploy and those svn external are down?
My advice is to use piston or gem unpack and manage your production dependancies in your vendor tree.
Disclaimer: I don't know Ruby/Rails, so I don't know what frozen gems are (though I assume they're compiled binaries or tokenized source), but I know Subversion well.
.svn directories only hold Subversion "bookkeeping". There's nothing in there that's unrecoverable.
Deleting your .svn files is not a problem at all. If the directories with the missing .svn directories are somewhere inside a tree of directories in your subversion working copy (the directory you did a checkout into), just delete those directories, do an svn update, and they will be recreated.
If the whole tree is missing the .svn files, delete the whole tree and do a svn checkout again.
svn:externals is like a "symbolic link". You have Project A and Project B, which uses Project A. What you do is add an svn:external property that references the library directory of Project A, so whenever you check out Project B, it will automatically put the library directory from Project A in it. For instance, I often have a directory called "thirdparty" which holds the externals to libraries from elsewhere, including evn:external references to other projects in subversion.
One tip for solving version problems like this is to have separate release directories for the libraries (or frozen gems), and in your projects that need them, use an svn:external reference to the appropriate release directory. As new releases come out, just change the svn:external property to point at the new release directory and svn update.

Resources