Github API compare a single directory between two SHAs - github-api

I'm trying to programmatically get a list of commits between two shas that have touched a certain directory.
Github's API supports comparison between two SHAS:
https://api.github.com/repos/github/linguist/compare/96d29b7662f148842486d46117786ccb7fcc8018...a20631af040b4901b7341839d9e76e31994adda3
Used to drive the UI comparison: https://github.com/github/linguist/compare/96d29b7662f148842486d46117786ccb7fcc8018...a20631af040b4901b7341839d9e76e31994adda3
Is there a way to add a path parameter to either of these? I would like just the comparison in the /lib directory, for example.

Related

Organizing common files in a separate area in depot

Typically, we have a depot root for every different product that we work on. For e.g.:
//products/productX
/productY
As the common files in the 2 products increase, I would like to put them into a top level folder of it's own
//products/productX
/productY
/common
Now to ensure that this works for all the users who have existing workspace, we would need to update all their workspaces. Is there an alternative? Can we put some markers in the depot to create a link it to a different folder? Any other option?
What you're describing is essentially the reason that streams were created -- the idea of a stream is that you definition the structure of a codeline in one place (e.g. "product X lives in //products/productX"), multiple people base their workspaces on that, and when you change it (e.g. "product X lives in //products/productX + //products/common), every workspace based on that definition updates automatically.
So if you're using streams, all you need to do is update the stream definitions that need to include the new //products/common directory. Easy!
If you're using "classic" workspaces, users who are using the default //products/... mapping will get the common directory automatically regardless. For users with custom views, my suggestion would be to alert them of the refactor and then let them make their own adjustments as appropriate; if they're familiar enough with Perforce to have built a custom client view, they may not appreciate having it changed underneath them.

Gitlab cross-reference project

I am trying to find the best way to document my project in Gitlab. And I found two different alternatives:
Markdown in the actual repository (my-repo.git)
Wiki using markdown (my-repo/wiki.git)
Note that the suffix .git indicates that these are two different git repositories.
I like the approach to simply modify the Wiki using markdown from the webpage (for everyones simplicity), but I am missing how to link between them or any other project in Gitlab.
In the documentation is provided some information to link (issues, commits, etc...) to other projects but not link files like the README.md and other documentation.
Is there such functionality?
I also don't know if I am 100% getting your question, but Gitlab does support special syntax for referencing other projects/commits/etc..
You can reference other project like so,
namespace/project>
It doesn't support referencing files in other projects (as far as I can tell), but you can reference files in the same project:
[README](doc/README.md)
And to specify a line number:
[README](doc/README.md#L13)
I don't know if I get your point to 100%.
Linking to other "files" is like links to any URL / URI in markdown. Use the "well-known" syntax [LinkName](LinkTarget).
A Link inside the same project
[Link to file, relative path](./README.md)
This should work in WIKIs and Project Markdown-files.
[Link to a file from other project](https://gitlab.com/{{USER or COMPANY}}/{{PROJECT}}/-/blob/master/{{FOLDER}}/README.md)
You can also use the reference syntax for links [LinkName][LinkReference] and then later in your file [LinkReference]: https://gitlab.com/foobar/123 when you want to reuse your links or collect them at the end of your file.

SVN tag files selectively

Gurus- We have a process to push only the modified files to integration and production environment. We will have to use 'Tag' mechanism. The process is to push the files along with the folders integration environment and another UI deployment process execute shell scripts to copy the files to respective folders and then run Make utility or ANT.
For e.g. /root/dev/scripts/ folder have files f1 and f2 in the branch, this branch can be used by multiple developers at the same time. If suppose only file f1 is modified , I should be doing the following steps.
1) Identify the files modified.
2) Create a tag out of the files selectively. In this example tag should contain /root/dev/scripts/f1.
Precisely my question is, how we can selectively find files and add to tag retaining the folder structure?

How to load files in a specific order

I would like to know how I can load some files in a specific order. For instance, I would like to load my files according to their timestamp, in order to make sure that subsequent data updates are replayed in the proper order.
Lets say I have 2 types of files : deal info files and risk files.
I would like to load T1_Info.csv, then T1_Risk.csv, T2_Info.csv, T2_Risk.csv...
I have tried to implement a comparator, as it is said on Confluence, but it seems that the loadInstructions file has the priority. It will order the Info files and the risk files independently. (loading T1_Info.csv, T2_Info.csv and then T1_Risk.csv, T2_Risk.csv..)
Do I have to implement a custom file loader, or is it possible using an AP configuration ?
The loading of the files based on load instructions is done in
com.quartetfs.tech.store.csv.impl.CSVDataModelFactory.load(List<FileLoadDescriptor>). The FileLoadDescriptor list you receive is created directly from the load instructions files.
What you can do is create a simple instructions files with 2 entries, one for deal info and one for risk. So your custom implementation of CSVDataModelFactory will be called with a list of two items. In your custom implementation you scan the directory where the files are, sort them in the order you want them to be parsed and call the super.load() with the list of FileLoadDescriptor you created from the directory scanning.
If you want to also load files that are place in the future in this folder you have to add to your load instructions a line that will match all files and that will make the super.load() implementation to create a directory watcher for that (you should then maybe override createDirectoryWatcher() to not watch the files already present in the folder when load is called).

Perforce and submodules

At work we are using Perforce and I wonder if it's possible to do submodules with it with versioning.
For example I have library A used by projects B and C.
I want to make it so that when I get revision of B I also get A in subfolder:
B
---=> A(v1)
Same goes for project C, but it would need newer version of library.
C
---=> A(v1.2)
I know this kind of thing is possible with Git, but could not find anything on it for Perforce.
Thanks,
Leonty
Perforce really handles this sort of thing with views and paths. These let you assemble the right set of files to put into a workspace (or branch or label). Since a Perforce repository can contain all of the components or modules for all your products, you just select which ones you want in a working data set. You don't need the submodule (or SVN external) concept to pull in data from another repository.
You can use template workspaces to make sure that developers get the right set of files to work on. You can be a little more rigorous and write some custom tools (possibly in the Perforce broker) to provide some structure.
The closest equivalent to using submodules is found in Perforce streams, where the paths define what goes into a stream. Stream paths are inherited by child streams. This isn't a direct equivalent though.

Resources