What's the difference between "git repository folder" and "existing work dir" in context of git_repository_open()? - libgit2

The docs for git_repository_open say:
The 'path' argument must point to either a git repository folder, or an existing work dir.
What does "existing work dir" that mean exactly? Can any subfolder be used? A detailed explanation or example would be so helpful.

Answered by cmn_ in #libgit2 on freenode:
<cmn_> shurcooL: you're right, I was thinking of git_repository_discover()
<cmn_> which *will* take any of those paths and give you the right one
<cmn_> shurcooL: what you usually call a "git repository" is two things, the gitdir and the worktree; the worktree is where you files live (and the top-level has the .git), and the gitdir is where git stores its data
<cmn_> what it's telling you is that if you have someproject/ and someproject/.git you can pass either of those paths and libgit2 will load the repository; the former being the worktree/workdir and the latter the repository

Related

Does Java Git API (JGit or others) Support finding renamed files between commits?

Does Java Git API, Example JGit support finding files between two commits that were renamed?
As example with command line git if I use git status I could see a view along the lines of
renamed: old-file-name -> new-file-name
I would like to get the same functionality (finding old name and new name) but from a java API call.
With JGit you can fetch diffs between arbitrary commits, branches and tags and get old-path and new-path for changed files. For these you can check if the path is different.
When performing a Diff, the class DiffEntry provides oldPath and newPath which you can compare.
See JavaDoc for DiffEntry.getOldPath() and DiffEntry.getNewPath() for the exact semantics.
The jgit-cookbook has a ready-to-run code-snippet DiffRenamedFile.java, the check for renaming is done here.

With scope based repository workpsace will all the members be able to check in the code.?

With scope based repository workpsace will all the members be able to check in the code.?
Or only deliver to the stream is possible like public repository work space.
With scope based repository workpsace will all the members be able to check in the code.?
No: only the owner of a repo workspace can check in code, or accept change set from other flow targets.
Or only deliver to the stream is possible like public repository work space.
No: only the owner of a repo workspace can initiate a deliver.
If you want to deliver change set from another repo workspace, you have to accept them in your own repo workspace first (by modifying its flow target in order to temporarily point to that other repo workspace), and then, once accepted, you can deliver them to the stream.

Syntax of Local.Properties In Hybris

I know that local.Properties overrides project.Properties.
I also know that that these files defineā€¦ database connections, ports, build environment, frontend HTTPS, etc.
I further know that project.Properties contains more properties.
Will appreciate if Hybris experts tell me syntax of local.Properties, illustrating with some example.
Please provide correct info.
If we talk about the syntaxes of entries in the project.properties file, then it is key=value
The property files in the hybris are of two types:
The extension level - The property file project.properties is the configuration file that carries properties in the key-value pair for the configurations involved on the extension level For instance, Consider a property in the project.properties of the yacceleratorstorefront (storefront template) extension storefront.storelocator.pageSize.Desktop=10 which clearly indicates the 'StoreLocator' results page size configuration per store. Since the store locator functionality is specific to the storefront and has no relevance for the other modules (like core, facades etc), the property is kept at the extension level.
Please note, project.properties reside in the extension folder
The global level - This is the property file which is the global configuration file, and deals with the properties are extension agnostic and carry a global impact. For instance the property commerceservices.default.desktop.ui.experience=responsive sets the ui experience to responsive mode that specifies the deployment to be for the responsive format.
The local.property file supersedes all of the properties with the same key that is defined in any of the project.proprties.
Please note, the local.properties file reside in the hybris/config folder
The hybris registry creates a property configuration map which constitutes all of the properties mentioned in the deployment configuration. The same could be managed in the HAC under platform/configuration.
The clear intent of the local.proprties file is to have information which either requires to be overriden on a global level. The override may be of different types, e.g. cart expiry time could be made different on different environments by the use of the local.property files.
For further reading, please refer to the link: https://wiki.hybris.com/display/release5/Configuring+the+Behavior+of+the+hybris+Commerce+Suite
property call hierarchy (from primary to secondary):
java -Dproperty.key=something
hybris/config/local.properties
hybris/*/(extension-name)/project.properties
hybris/bin/platform/project.properties
and within java code:
configService.getString("property.key", "last fallback value, if no propertyfile provide this key");
You could review all current variables using the hac interface for properties: http://localhost:9001/platform/config

How to explain NFS crossmnt argument?

A client of mine discovered that he needs to include 'crossmnt' along with his NFS export options. I am going to write the option into our software, so that he doesn't have to put in a hack and can use crossmnt as a real option.
Is this a correct explanation of crossmnt that I can use in our docs?
Crossmnt allows the NFS client to traverse the directories below the exported root. For example:
etc/exports:
/exports *(fsid=0,ro,root_squash,sync)
/exports/doc *(ro,root_squash,bind=/usr/share/doc)
With crossmnt, the client can see the contents of /exports/doc as the subfolder of /exports, while without crossmnt, doc would appear to be an empty folder.
This video was used for an example:
https://www.youtube.com/watch?v=-9cJciX8dB8
Does that sound right? Thank you.
I believe that there is something missing in this explanation.. what i know from crossmount is that it allows you to see a mounting point inside an exported directory. If the exported directory doesn't have any partition mounted over its subfolders, they should be visible in the client side of the NFS.
For example, if you have an exported directory over "/mnt/testing_dir", with this content:
/mnt/testing_dir/
dir1/
text1.txt
executable.bin
dir2/ (mount point for /dev/sda6)
doc1
doc2
The "dir1" will be visible even if without the "crossmnt" option. However, "dir2", as it is a mounting point, will be visible with the "crossmnt" option, and will be empty without it (unless you use another options like "nohide").
Reference:
crossmnt -
This option is similar to nohide but it makes it possible for clients to move from the filesystem marked with crossmnt to exported filesystems mounted on it. Thus when a child filesystem "B" is mounted on a parent "A", setting crossmnt on "A" has the same effect as setting "nohide" on B.

Maven profile activation based on classpath property

Is it possible to activate a Maven profile based on a classpath property that you in turn set based on reading a properties file? I have verified that the classpath exists at the phase where my profile is supposed to take effect, and also separately gave the property through command line which worked, but when I attempt to read it from properties file, and attempt to run the profile based on classpath property, it does not work. I even tried setting the interested property as system property hoping that profile will be activated, but same result. This link refers as if classpath properties can be read, but this link mentions as if only system properties can be read for profile activation. However, for me both don't work. Any pointers will be helpful.
Thanks,
Paddy