Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0495f96f8d | ||
|
|
14beea150d | ||
|
|
1c703f285e | ||
|
|
9799df2147 | ||
|
|
49642cfb71 | ||
|
|
3e01b11c09 | ||
|
|
6d390376d8 | ||
|
|
10c1d54c2d |
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools >= 61.0"]
|
requires = ["setuptools >= 80", "setuptools-scm[simple] >= 8" ]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "git-flow"
|
name = "git-flow"
|
||||||
description = "Git workflow automation to follow best practices"
|
description = "Git workflow automation to follow best practices"
|
||||||
version = "v1.0.0"
|
dynamic = ["version"]
|
||||||
requires-python = ">= 3.12"
|
requires-python = ">= 3.12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"requests"
|
"requests"
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ def merge_command():
|
|||||||
print("Cambios a mergear:")
|
print("Cambios a mergear:")
|
||||||
|
|
||||||
for commit in commits:
|
for commit in commits:
|
||||||
if commit != Git.UPDATED_CHANGELOG_MSG:
|
if commit != Git.BUMP_VERSION:
|
||||||
print("- " + commit)
|
print("- " + commit)
|
||||||
|
|
||||||
merge_conflicts = Git("merge", target, ff=False, commit=False).exec()
|
merge_conflicts = Git("merge", target, ff=False, commit=False).exec()
|
||||||
@@ -404,9 +404,10 @@ def tag_command():
|
|||||||
[service, repository] = parse_url(url)
|
[service, repository] = parse_url(url)
|
||||||
create_tag(service, repository, token, new_version, commit)
|
create_tag(service, repository, token, new_version, commit)
|
||||||
|
|
||||||
if update_changelog(merged_branch, branch):
|
merged_commit = Git("show", "HEAD^2", patch=False, format="%H").firstline()
|
||||||
|
if update_changelog(merged_commit, branch):
|
||||||
Git("add", Git.CHANGELOG_FILE).exec()
|
Git("add", Git.CHANGELOG_FILE).exec()
|
||||||
Git("commit", message=Git.UPDATED_CHANGELOG_MSG).exec()
|
Git("commit", message=Git.BUMP_VERSION).exec()
|
||||||
Git("push").exec()
|
Git("push").exec()
|
||||||
else:
|
else:
|
||||||
Git("tag", new_version, commit).exec()
|
Git("tag", new_version, commit).exec()
|
||||||
@@ -523,7 +524,7 @@ def get_unique_branch_name(branch_type):
|
|||||||
def update_changelog(branch: str, target: str):
|
def update_changelog(branch: str, target: str):
|
||||||
last_commit = Git("show", "HEAD", no_patch=True, format="%s").firstline()
|
last_commit = Git("show", "HEAD", no_patch=True, format="%s").firstline()
|
||||||
|
|
||||||
if last_commit == Git.UPDATED_CHANGELOG_MSG:
|
if last_commit == Git.BUMP_VERSION:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
content = generate_changelog_entry(branch, target)
|
content = generate_changelog_entry(branch, target)
|
||||||
@@ -568,14 +569,14 @@ def get_changelog_content_lines(branch: str, target: str):
|
|||||||
email = Git("show", commit, patch=False, format="%ae").firstline()
|
email = Git("show", commit, patch=False, format="%ae").firstline()
|
||||||
username = email[:email.index('@')]
|
username = email[:email.index('@')]
|
||||||
|
|
||||||
if message == Git.UPDATED_CHANGELOG_MSG:
|
if message == Git.BUMP_VERSION:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
index = message.index(":")
|
index = message.index(":")
|
||||||
commit_type = message[:index]
|
commit_type = message[:index]
|
||||||
commit_message = message[index+1:]
|
commit_message = message[index+1:]
|
||||||
|
|
||||||
lines.append(f"- **{commit_type}**: {commit_message} por [{username}]({email}) ({commit})")
|
lines.append(f"- **{commit_type}**: {commit_message} [[{username}](mailto:{email})] ({commit})")
|
||||||
|
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
@@ -598,7 +599,7 @@ def generate_changelog_entry(branch: str, target: str):
|
|||||||
def create_pull_request(service: str, repository: str, source: str, destination: str):
|
def create_pull_request(service: str, repository: str, source: str, destination: str):
|
||||||
endpoint = get_api_endpoint(service, repository, "/pullrequests")
|
endpoint = get_api_endpoint(service, repository, "/pullrequests")
|
||||||
title = source.replace("/", ": ").replace("-", " ")
|
title = source.replace("/", ": ").replace("-", " ")
|
||||||
description = "\n".join(get_changelog_content_lines(destination))
|
description = "\n".join(get_changelog_content_lines(source, destination))
|
||||||
headers = get_headers()
|
headers = get_headers()
|
||||||
|
|
||||||
json = {
|
json = {
|
||||||
|
|||||||
Reference in New Issue
Block a user