Skip to content

Commit e48d648

Browse files
committed
dev: new attempt for version.txt updates
1 parent 724408d commit e48d648

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
layouts/partials/version.txt merge=ours

.githooks/post-commit.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,20 @@
1414
# #!/bin/sh
1515
# python3 .githooks/post-commit.py
1616
# ```
17+
#
18+
# also add the following line to your ".git/config" to avoid
19+
# merge conflicts on amending the commit during a merge or rebase
20+
#
21+
# ```sh
22+
# git config --local merge.ours.driver true
23+
# ```
1724

1825
from datetime import datetime
1926
import os
2027
import re
2128
import subprocess
2229

23-
def is_special_git_operation():
24-
git_dir = subprocess.check_output(['git', 'rev-parse', '--git-dir'], universal_newlines=True).strip()
25-
indicators = [
26-
os.path.join(git_dir, 'rebase-merge'),
27-
os.path.join(git_dir, 'rebase-apply'),
28-
os.path.join(git_dir, 'CHERRY_PICK_HEAD'),
29-
os.path.join(git_dir, 'MERGE_HEAD'),
30-
os.path.join(git_dir, 'BISECT_LOG'),
31-
os.path.join(git_dir, 'REVERT_HEAD'),
32-
]
33-
return any(os.path.exists(ind) for ind in indicators)
34-
3530
def update_version(script_name, log_file, time, repo_name):
36-
if is_special_git_operation():
37-
print(f'{time}: {repo_name} - {script_name} - Skipping during rebase/cherry-pick/merge', file=open(log_file, "a"))
38-
return
39-
4031
file_path = 'layouts/partials/version.txt'
4132
try:
4233
f = open(file_path, 'r+')

layouts/partials/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.0.3+72320bd911bdb2bc8cb45e6a62de2b061afa3cad
1+
9.0.3+724408dbdb33a50847bfdb2163b85624843ea35f

0 commit comments

Comments
 (0)