0
0
فهرست منبع

feat(lazygit): add option to unify author / commit time

Joe 11 ماه پیش
والد
کامیت
7a25051bf1
1فایلهای تغییر یافته به همراه15 افزوده شده و 3 حذف شده
  1. 15 3
      .config/lazygit/config.yml

+ 15 - 3
.config/lazygit/config.yml

@@ -113,6 +113,15 @@ customCommands:
           Scope: {{.Form.Scope}}
           Scope: {{.Form.Scope}}
           Breaking Change: {{.Form.Breaking}}
           Breaking Change: {{.Form.Breaking}}
 
 
+  - key: "<c-r>"
+    context: "commits"
+    description: "Set commit dates to author dates"
+    command: git rebase "{{ .SelectedCommit.Sha }}^"  --committer-date-is-author-date
+    prompts:
+      - type: "confirm"
+        title: "Set commit dates to author dates"
+        body: "Are you sure you want to set commit dates equal to author dates?"
+
   - key: "<c-a>"
   - key: "<c-a>"
     context: "commits"
     context: "commits"
     description: "Modify author date and commit date"
     description: "Modify author date and commit date"
@@ -132,9 +141,12 @@ customCommands:
         title: "Select Timestamp"
         title: "Select Timestamp"
         key: "InitialValue"
         key: "InitialValue"
         command: |
         command: |
-          bash -c "date \"+%Y-%m-%d %H:%M:%S %z\";
-          git log --pretty=format:%ad --date=iso | uniq | head -7;
-          echo;
+          bash -c "date \"+%Y-%m-%d %H:00:00 %z\";
+          date \"+%Y-%m-%d %H:%M:%S %z\";
+          git log --pretty=format:%ad --date=iso | uniq | head -1;
+          echo \"- Past author dates:\";
+          git log --pretty=format:%ad --date=iso | uniq | head -5;
+          echo \"- Dummy timestamps:\";
           echo 2005-04-07 15:13:13 -0700;
           echo 2005-04-07 15:13:13 -0700;
           echo 0000-00-00 00:00:00 +0000;"
           echo 0000-00-00 00:00:00 +0000;"
       - type: "input"
       - type: "input"