# # Copyright 2018 Google LLC. All Rights Reserved. # Copyright 2017-2018 Nest Labs Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # Description: # This file is the make "header" or pre make header that defines make # convenience macros for interacting with git. # # nlGitGetConfigFromFileCommand # # Command to get a value for a variable set in the specified git config file . nlGitGetConfigFromFileCommand = $(GIT) config --file $(1) # nlGitListConfigFromFileCommand # # Command to list all variables set in the specified config file nlGitListConfigFromFileCommand = $(call nlGitGetConfigFromFileCommand,$(1)) --list # nlGitGetConfigFromFile # # Get a value for a variable set in the specified git config file . nlGitGetConfigFromFile = $(shell $(call nlGitGetConfigFromFileCommand,$(1))) # nlGitListConfigFromFile # # List all variables set in the specified config file nlGitListConfigFromFile = $(shell $(call nlGitListConfigFromFileCommand,$(1))) # nlGitGetValueForRepoFromNameFromFile # # Get a value for a repo / submodule variable set in specified git config file . nlGitGetValueForRepoFromNameFromFile = $(shell $(call nlGitGetConfigFromFileCommand,$(1)) 'submodule.$(2).$(3)') # nlGitGetBranchForRepoFromNameFromFile # # Get the remote branch for a repo / submodule variable set in specified git config file . nlGitGetBranchForRepoFromNameFromFile = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),branch) # nlGitGetCommitForRepoFromNameFromFile # # Get the commit for a repo / submodule variable set in specified git config file . nlGitGetCommitForRepoFromNameFromFile = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),commit) # nlGitGetURLForRepoFromNameFromFile # # Get the remote URL for a repo / submodule variable set in specified git config file . nlGitGetURLForRepoFromNameFromFile = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),url) # nlGitGetPathForRepoFromNameFromFile # # Get the local path for a repo / submodule variable set in specified git config file . nlGitGetPathForRepoFromNameFromFile = $(call nlGitGetValueForRepoFromNameFromFile,$(1),$(2),path) # nlGitGetMethodForPullFromFile # # Get the pull method set in specified git config file . nlGitGetMethodForPullFromFile = $(shell $(call nlGitGetConfigFromFileCommand,$(1)) 'pull.method')