Abhinandankaushik commented on code in PR #149:
URL: https://github.com/apache/datafusion-site/pull/149#discussion_r2780426172


##########
Makefile:
##########
@@ -32,15 +31,17 @@ clone-repo:
                echo "$(REPO_NAME) already exists, skipping clone."; \
        fi
 
-# checks out the specific commit due to 
https://github.com/apache/infrastructure-actions/issues/218
-checkout-commit: clone-repo
+# syncs the repository with the latest changes from the main branch
+sync-repo: clone-repo
        @cd $(REPO_NAME) && \
-       if [ "$$(git rev-parse HEAD)" = "$(COMMIT_HASH)" ]; then \
-               echo "Repository is already at commit $(COMMIT_HASH), skipping 
checkout."; \
-       else \
-               echo "Checking out commit $(COMMIT_HASH)..."; \
-               git fetch --depth 1 origin $(COMMIT_HASH) && git checkout 
$(COMMIT_HASH); \
-       fi
+       if [ -n "$$(git status --porcelain)" ]; then \
+               echo "Error: Repository has uncommitted changes. Please clean 
the repository first."; \
+               exit 1; \
+       fi; \
+       echo "Syncing with origin/main..."; \
+       git fetch --depth 1 origin main && \
+       git checkout main && \
+       git reset --hard origin/main

Review Comment:
   No — it is not strictly necessary. Whether you need git reset --hard 
origin/main depends on what you want to guarantee in this Makefile target.
   This Forcefully moves your local main to exactly match origin/main
   So that  it guarantee a clean, exact match with origin/main, regardless of:
   - Local modifications
   - Diverged commits
   - Uncommitted changes
   - Previous experiments on main
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to