Skip to content

Commit

Permalink
define git actor for repo.create_tag command (fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Mar 29, 2024
1 parent 3b21c41 commit 82a5630
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 5 additions & 4 deletions seal5/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

from seal5.dependencies import cdsl2llvm_dependency
from seal5 import utils
from seal5.tools import llvm, cdsl2llvm, git as git_, inject_patches
from seal5.tools import llvm, cdsl2llvm, inject_patches
from seal5.resources.resources import get_patches, get_test_cfg
from seal5.passes import Seal5Pass, PassType, PassScope, PassManager, filter_passes
import seal5.pass_list as passes
Expand Down Expand Up @@ -634,9 +634,10 @@ def patch(self, verbose: bool = False, stages: List[PatchStage] = None, force: b
self.apply_patch(patch, force=force)
assert self.repo is not None
tag_name = f"seal5-{self.name}-stage{int(stage)}"
tag_msg = f"Patched Seal5 LLVM after {stage}"
author = git_.get_author(self.settings.git)
self.repo.create_tag(tag_name, message=tag_msg, force=True, author=author)
tag_msg = f"Patched Seal5 LLVM after stage {stage}"
# author = git_.get_author(self.settings.git)
# self.repo.create_tag(tag_name, message=tag_msg, force=True, author=author)
self.repo.create_tag(tag_name, message=tag_msg, force=True)
end = time.time()
diff = end - start
metrics["time_s"] = diff
Expand Down
11 changes: 8 additions & 3 deletions seal5/tools/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from seal5 import utils
from seal5.logging import get_logger
from seal5.tools.git import get_author
from seal5.tools.git import get_author_from_settings
from seal5.settings import GitSettings

logger = get_logger()
Expand Down Expand Up @@ -79,8 +79,13 @@ def clone_llvm_repo(
if ref:
logger.debug("Checking out branch: %s", ref)
repo.git.checkout(ref)
author = get_author(git_settings)
repo.create_tag(f"seal5-{label}-base", "-f", author=author)
# Set author in repo config
author = get_author_from_settings(git_settings)
with repo.config_writer() as writer:
writer.set_value("user", "name", author.name)
writer.set_value("user", "email", author.email)
# repo.create_tag(f"seal5-{label}-base", "-f", author=author)
repo.create_tag(f"seal5-{label}-base", "-f")
# git describe --tags --match "llvmorg-[0-9]*.[0-9]*.[0-9]*"
describe = repo.git.describe("--tags", "--match", "llvmorg-[0-9]*.[0-9]*.[0-9]*")
if describe:
Expand Down

0 comments on commit 82a5630

Please sign in to comment.