generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update git fetch command and remove git pull command #548
Merged
tromai
merged 16 commits into
staging
from
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
Dec 22, 2023
Merged
chore: update git fetch command and remove git pull command #548
tromai
merged 16 commits into
staging
from
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
Dec 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tromai
added
bug
Something isn't working
git_operations
The issues realated to the git operations that Macaron makes on the target repository
labels
Nov 7, 2023
oracle-contributor-agreement
bot
added
the
OCA Verified
All contributors have signed the Oracle Contributor Agreement.
label
Nov 7, 2023
tromai
changed the title
chore: use add --force and --tags flags to git fetch
chore: use add --force and --tags flags to git fetch (WIP)
Nov 7, 2023
Please also address this issue in this PR and make it a more general optimization for git operations. |
tromai
force-pushed
the
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
branch
from
November 7, 2023 04:04
c91440e
to
28144e7
Compare
tromai
changed the title
chore: use add --force and --tags flags to git fetch (WIP)
chore: update git fetch command and remove git pull command
Nov 7, 2023
tromai
force-pushed
the
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
branch
2 times, most recently
from
November 10, 2023 04:54
ce3dda7
to
079e515
Compare
nathanwn
reviewed
Nov 13, 2023
nathanwn
reviewed
Nov 13, 2023
nathanwn
reviewed
Nov 13, 2023
tests/dependency_analyzer/configurations/micronaut_core_config.yaml
Outdated
Show resolved
Hide resolved
tromai
force-pushed
the
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
branch
from
November 13, 2023 06:31
079e515
to
73f3e87
Compare
nathanwn
reviewed
Nov 14, 2023
tromai
force-pushed
the
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
branch
from
December 6, 2023 00:22
7ee578f
to
141b4de
Compare
tromai
force-pushed
the
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
branch
from
December 19, 2023 02:29
141b4de
to
b37c190
Compare
* Remove git pull and use the new design where the branch is not used to checked out anymore. * Update some integrations tests where the tag is used as the branch, which is not correct. * Implement a function to find all remote branches that contain a commit. Signed-off-by: Trong Nhan Mai <[email protected]>
…et_branches_containing_commit for clarity Signed-off-by: Trong Nhan Mai <[email protected]>
Signed-off-by: Trong Nhan Mai <[email protected]>
behnazh-w
reviewed
Dec 20, 2023
tests/dependency_analyzer/expected_results/skipdep_micronaut-projects_micronaut-test.json
Outdated
Show resolved
Hide resolved
…ng to provide a branch name
behnazh-w
reviewed
Dec 22, 2023
…the yaml config file
…one that does the same
behnazh-w
approved these changes
Dec 22, 2023
tromai
deleted the
547-running-git-fetch-only-does-not-guarantee-that-we-have-fetched-all-changes-related-to-tags
branch
December 22, 2023 05:12
art1f1c3R
pushed a commit
that referenced
this pull request
Nov 29, 2024
Signed-off-by: Trong Nhan Mai <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
git_operations
The issues realated to the git operations that Macaron makes on the target repository
OCA Verified
All contributors have signed the Oracle Contributor Agreement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #547
Closes #519
This PR does the following changes to the
check_out_repo_target
function.Add additional flags to the git fetch command
For more details on why and which flags were used, see #547
See commit 46cb61d
Remove unnecessary logging in the
check_out_repo_target
functionSee commit fe81a0c
Remove git pull, instead check out the latest commit directly
For more details on why, see #519.
This change is incorporated with the new design of
check_out_repo_target
.Implement a new design for the
check_out_repo_target
functionSee commit ce3dda7
Current supported use cases of "checking out" a specific branch and/or commit in Macaron:
The new design will remove the need for checking out a branch, and instead check out the target commit directly.
origin/HEAD
->git checkout --force origin/HEAD
.git checkout --force origin/<branch_name>
. Assume that git fetch has updated the local repository to be the up-to-date version of remote, this command will ensure that the referenceorigin/<branch_name>
always point to the latest commit of that branch as observed from remote. For more information on why it is, see the Remotes section in this article.git checkout --force <commit>
if we have made sure that the commit exists in the user provided branch.Why "origin" remote but not other remote?
<output>/git_repos
, Macaron just clones and do nothing else. This mean that the default origin remote always exist.The drawback of pinning the remote named origin is not large. The only issue I can see right now is if we run the analysis on a local repository provided by the user. However, we could put some documentation saying that we expect the origin remote is the repository we want to analyze.
How to find all the branches from origin remote whose history contains a commit hash.
To find all branches that contains a specified commit we could use the
git branch
command as documented here.Ideally, what we want to run is:
The
-r
flag ensures that it only returns the branch from all remotes in the repositoriesThe
--list origin/*
makes sure to only filter out the branches that are tracked from the origin remote.The
--contains <commit_hash>
makes sure that only return the branch names that contain the commit hash we are interested in.For example, let's try that on the Macaron repository:
I have create a function in
git_url.py
to perform the above command and extract the list of branches from the output. With the above example, we will have a list of string:[..., "origin/main", "origin/staging", ...]
whose elements are the branches that contains the commit we are interested in.