Possible to move Origen test_ids gem JSON files to sub-dirs within a Git repo? - origen-sdk

I use the test_ids gem to keep track of my binning. I noticed it stores the JSON binning files at the top level of the Git repository. Is it possible to place them in a sub-directory?
thx

Not currently, users caring about the internal storage file layout was not something that had been thought about until now.

Related

Share one file across multiple git repo to be updated by multiple users

I am working on automating the markdown spell check for all the documents on my website which involves multiple git repo. I have a .spelling file that contains all the word to be excluded from the documents. I would like to keep it one file and updated across the entire website. I can get it to work for one repo. I looked into the npm package method. Is there a way to configure package.json to share this file to many repo? Or is there a better way to do it without npm? Thanks!
Make a separate spell-check repository with the .spelling file and script in it, then include it as a submodule in each of your docs repos. You can then reference it from each repository separately, and pull its latest updates into each one.
This could be cumbersome if you have a large number of docs repos, so another alternative is to centralize the spelling check script by making a separate repository for it and adding a configuration file to tell your script which Github repositories to spellcheck. This way, you can selectively apply the spell check process to any number of repositories in your organization.

Create git history, blob and tree objects, in parallel

our company have decided to migrate our source code from clearcase to git, that's great :-)
I know that clearcase and git are completely different source code management systems.
But we developer, would have only one SCM that containing the complete history.
My colleague found the following tool, which importing our clearcase history into git: https://github.com/charleso/git-cc
Unfortunately our code has more than 46000 source code files and the history to import is more than 10 years.
I analyzed this tool and in my opinion there are two bottlenecks.
The first is the import of files from clearcase server. This is easy to solve by doing this in multiple threads.
The second is the workflow of git-cc itself.
Get history of master-branch via cleartool lshistory
Create changesets of files and group them to comit's
Get specified version of file(s) from cc server and copy to working directory
git add .
git commit
pick next group and start with 3. again
I think I could improve it by using low level git commands and using multiple threads.
Each commit-group queries its changes from server and creating a blob object within git database, so this could run for multiple groups in multiple threads.
Additional I have one thread which create the history in git from just now created blob objects.
My question is now, does this make sense to you or do you think I'm naive?
Have I forget any git locking mechanism?
Have you any other ideas?
Using multiple thread for importing commits in the same branch of a Git repo is risky (unless, as you put it, you create "blob object", that is patches that you can replay).
But using multiple thread for commits on different branches is possible: you create different repo, each one for a branch import, and then you can fetch those repos into one common repo and reattach them with git replace or grafts.
But remember: each Git repo is a component, so if your giant ClearCase Vob includes several components (group of files), it would be best to separate them in multiple Git repo rather than attempting to create a giant Git one.
I detail that in "ClearCase to Git migration".

Prevent commit of files with same names

Assuming there's a Git repository hosted on a Linux machine and there are developers using both Windows and Linux, is there a way to prevent Linux developers from committing files with same names but different cases?
I think I've to write a server-side hook for this, but I don't know how to validate the names of incoming files inside the hook script.
Any help/references related to this would be appreciated.
If you want keep some files locally then git stash is your friend. stash usage

GitHub API: Update contents of a file with a diff?

According to http://developer.github.com/v3/repos/contents/ the GitHub API can be used to upload the full contents of a file. I'm planning to use the API in a project that will change dependency definitions, so basically changing single lines. If I can only upload a full file, I need extra logic to avoid race-conditions (current best idea is branching from the version I'm starting from, then merging).
Is there a way to upload a diff instead of the whole file?
I'd prefer to use the API instead of cloning the repositories and using Git proper (big repositories, other kinds of race conditions).
There's no way to upload a diff currently. It's on the feature request list, though. :)

How to set up a git repository where different users can only see certain parts?

How do you set up a git repository where some users can see certain parts of the source code and other users can see all of it? I've seen lots of guides for only giving certain users commit access, but these assume everyone should have read access. I've also heard of gitosis, but I'm not sure it supports this and it hasn't had any commits in over a year so I think it's dead.
In short: you can't. Git is snapshot based (at conceptual level at least) version control system, not changeset based one. It treats project (repository) as a whole. The history is a history of a project, not a union of single-file histories (it is more than joining of per-file histories).
Using hooks like update-paranoid hook in contrib, or VREFs mechanism of gitolite, you can allow or forbid access to repository, you can allow or forbid access to individual branches. You can even forbid any commits that change things in specified subdirectory. But the project is always treated as a whole.
Well, there is one thing you can do: make a directory you want to restrict access to into submodule, and restrict access to this submodule repository.
The native git protocol doesn't support this; git assumes in many places that everybody has a complete copy of all of the history.
That said, one option may be to use git-subtree to split off part of the repository into its own subset repository, and periodically merge back.
Git doesn't support access control on the repository. You can however, implement access control on the repository yourself, by using hooks, more specifically the update hook.
Jörg has already pointed out that you can use hooks to do this. Exactly which hook(s) you need depends on your setup. If you want the permissions on a repo that gets pushed to, you'll need the update hook like he said. However, if it's on a repo that you're actually working in (committing and merging), you'll also need the pre-commit and post-merge hooks. The githooks manpage (Jörg linked to this too) notes that there's in fact a script in the contrib section demonstrating a way to do this. You can get this by grabbing a git tarball, or pull it out of git's gitweb repo: setgitperms.perl. Even if you're only using the update hook, that might be a useful model.
In general, Git is not intended for this. By now it seems to have out-of-the-box access control only up to the repository level.
But if you need just to hide some part of secret information in your Git repository (which is often the case) you can use git-crypt (https://github.com/AGWA/git-crypt) with encryption keys shared based on users GPG keys (https://gnupg.org/).
Alternatively you can use git submodules (https://git-scm.com/book/en/v2/Git-Tools-Submodules) if you can break your codebase to logical parts. Then all users receive access only to certain repositories which you then integrate into 'large' codebase through sub-modules where you add other code and allow it for only 'privileged' users.

Resources