☰ Categories

Developer Work Analysis from Git Diff and Commit Message

a Code Review Expert. You are an experienced software developer with expertise in code analysis and version control systems.

CategoryDevelopment › Coding
TagsAnalyzingReviewingDeveloperCode
Prompt
Act as a Code Review Expert. You are an experienced software developer with expertise in code analysis and version control systems.

Your task is to analyze a developer's work based on the provided git diff file and commit message. You will:
- Assess the scope and impact of the changes.
- Identify any potential issues or improvements.
- Summarize the key modifications and their implications.

Rules:
- Focus on clarity and conciseness.
- Highlight significant changes with explanations.
- Use code-specific terminology where applicable.

Example:
Input:
- Git Diff: ${sample_diff_content}
- Commit Message: ${sample_commit_message}

Output:
- Summary: ${concise_summary_of_the_changes}
- Key Changes: ${list_of_significant_changes}
- Recommendations: ${suggestions_for_improvement}

What this prompt does

This code review role is useful for reviewing code changes or turning them into a work report. It asks for clear, concise analysis and structures the output as summary, key changes, and recommendations.

Model comparison

ChatGPT has the best balance of accuracy, concision, and structure. Gemini is specific but somewhat verbose, while [C] is missing.

ChatGPTTop overall
49/ 50

+ Clearly covers intent, impact, and relevant tests.

- Some defensive checks extend slightly beyond the change scope.

Gemini
45/ 50

+ Explains the logic and encapsulation improvements concretely.

- English headings and expansive design advice reduce concision.

CriterionChatGPTGeminiLeader
Instruction following109ChatGPT +11%
Accuracy109ChatGPT +11%
Specificity1010Tie
Structure109ChatGPT +11%
Right length98ChatGPT +13%

Scored 1–10 by gpt-5.6-sol with model names hidden (2026-09-25). This is an AI review, not a measurement.

Read full answers

We gave three models the same input and copied their answers unedited. Each ran in its CLI (an agent harness), and answers in the ChatGPT or Claude apps or on the web may differ. Outputs are in Korean.

Input used
[Pasted material]
Git Diff:
diff --git a/src/main/java/com/shopmate/payment/PaymentService.java b/src/main/java/com/shopmate/payment/PaymentService.java
index 3a1f2c9..8b7e421 100644
--- a/src/main/java/com/shopmate/payment/PaymentService.java
+++ b/src/main/java/com/shopmate/payment/PaymentService.java
@@ -42,7 +42,10 @@ public class PaymentService {
     public PaymentResult processPayment(Order order) {
-        BigDecimal amount = order.getDiscount().getFinalAmount();
+        Discount discount = order.getDiscount();
+        BigDecimal amount = (discount != null)
+                ? discount.getFinalAmount()
+                : order.getTotalAmount();
         return pgClient.charge(order.getUserId(), amount);
     }

Commit Message:
fix: 쿠폰 미적용 주문에서 결제 시 NPE 발생하는 문제 수정

order.getDiscount()가 null인 경우(쿠폰 미사용 주문) getFinalAmount() 호출 시
NullPointerException이 발생하던 버그 수정. discount가 없으면 정가(totalAmount)로 결제하도록 처리.
gpt-5.6-luna (codex CLI · 에이전트 하네스) · Run on 2026-09-24
  • 요약: 쿠폰이 적용되지 않은 주문에서 order.getDiscount()가 null일 때 발생하던 NullPointerException을 방지하고, 할인 정보가 없으면 주문 총액(totalAmount)을 결제하도록 수정했습니다.

  • 주요 변경사항:

    • Discount 객체를 지역 변수로 추출했습니다.
    • 할인 정보가 있으면 getFinalAmount()를 사용합니다.
    • 할인 정보가 없으면 order.getTotalAmount()를 사용합니다.
    • 결제 승인 로직의 NPE 발생 경로가 제거되었습니다.
  • 영향 및 검토 의견:

    • 쿠폰 미사용 주문도 정상적으로 정가 결제가 가능해져 버그 수정 의도와 일치합니다.
    • order 자체 또는 order.getTotalAmount()가 null일 가능성이 있다면 추가적인 검증이 필요합니다.
    • 할인 금액 계산 규칙이 다른 곳에서도 사용된다면, 결제 서비스에서 직접 분기하기보다 Order 또는 금액 계산 도메인 로직으로 캡슐화하는 것을 고려할 수 있습니다.
  • 권장사항:

    • 할인 적용 주문, 쿠폰 미사용 주문, totalAmount 경계값에 대한 단위 테스트를 추가하세요.
    • 결제 요청 직전 금액이 음수이거나 null인 경우를 검증하는 방어 로직이 있는지 확인하세요.

More in this category

12-Month AI and Computer Vision Roadmap for Defense Applications
2046 Puzzle Game Challenge
21st.dev component prompt
3D FACTORY
3D FPS Game