Skip to content

Conversation

@sgaud-quic
Copy link

This is intended to add functionality in automerge to capture topic branch SHA that are getting merged into the baseline. This will generate a file qcom-next/topic_SHA1 which will have topic brancg name and the SHA that is merged in baseline while running automerge tool.

ci-merge Outdated
echo "Merging topic branches..."

mkdir qcom-next
printf "%*s %*s\n" 10 "Name" 20 "SHA1" > qcom-next/topic_SHA1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not redirect o/p to hardcoded file from within code. You can print info here, and then pass to some script to generate o/p in a preferred format that goes into topic_SHA1 file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

ci-merge Outdated
if echo "$MERGE_OUTPUT" | grep -q "Already up to date." ; then
echo "Nothing to merge: Already up to date."
else
printf "%-20s %*s\n" "$REMOTE_NAME" 45 "$branch_tip" >> qcom-next/topic_SHA1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

ci-merge Outdated

git merge -q --no-ff --no-edit -m "Merge remote-tracking branch $REMOTE_NAME into $INTEG_BRANCH" $MERGER
branch_tip=$(git rev-parse $MERGER)
MERGE_OUTPUT=$(git merge --no-ff --no-edit -m "Merge remote-tracking branch $REMOTE_NAME into $INTEG_BRANCH" $MERGER 2>&1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 2>&1 necessary ? you can work with all err + success output log ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@sgaud-quic sgaud-quic force-pushed the logging branch 3 times, most recently from fd80905 to 9b5c743 Compare June 10, 2025 12:39
Introducing a option -p, which will bypass a conflicting branch
in case of non-interactive merge.
Branch would be reset with git merge --abort and next branch
would be merged, instead of exiting.

Signed-off-by: Salendarsingh Gaud <[email protected]>
Script to parse the merge logs, this will search for
"Merge sucessful: " string and capture branch name and SHA
in a text file.

Signed-off-by: Salendarsingh Gaud <[email protected]>
@sgaud-quic sgaud-quic changed the title ci-merge : Change to capture topic branch SHA ci-merge : Adding option to bypass topic branch in case of merge conflicts and adding a log-parser Jun 10, 2025
@sgaud-quic sgaud-quic requested a review from shashim-quic June 10, 2025 16:26
Calculate and print number of commits present in each branch
that is merged into baseline.

Signed-off-by: Salendarsingh Gaud <[email protected]>
Parse number of commits from log file and add to topic_SHA1 file

Signed-off-by: Salendarsingh Gaud <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants