TODO: parse URL paramters correctly

This commit is contained in:
armistace 2025-05-29 17:29:48 +10:00
parent 1bb99c2343
commit 546b86738a
2 changed files with 25 additions and 5 deletions

View File

@ -0,0 +1,19 @@
## When to Use AI
Right, lets talk about AI. Its the buzzword of the moment, but when is it actually useful? Ive been asked this question a lot recently, so here are two scenarios where AI isnt the silver bullet everyone thinks it is—and where it could genuinely save some time.
### 1. **Contextual Mapping in Workload Analysis**
I was building a spreadsheet to analyze workload drivers and potential savings. The dataset included thousands of work orders with categories like "work types" and durations. Merging these required manually mapping each work type to a category. This is where generative AI excelled—it interpreted text relationships, something regex or string manipulation couldnt handle. LLMs are perfect for understanding context and nuance.
### 2. **Precision in Calculations**
For calculating workload drivers and formulas, precision was key. These required sound math and logic, not interpretation. Trusting an LLM here felt risky—AI might introduce unexpected variables (like changing π to a non-numeric value). Traditional methods ensure accuracy without existential crises.
**Key Takeaways:**
- **Use AI** for interpreting text and relationships.
- **Stick to traditional methods** for precise calculations.
- **Never fully trust AI**; always verify output.
---
**What do you think? Let me know in the comments below!**
<|end_of_thought|>

View File

@ -10,6 +10,7 @@ class GitRepository:
def __init__(self, repo_path, username=None, password=None):
git_protocol = os.environ["GIT_PROTOCOL"]
git_remote = os.environ["GIT_REMOTE"]
#TODO: Parse the URL correctly https://stackoverflow.com/questions/1695183/how-can-i-percent-encode-url-parameters-in-python
remote = f"{git_protocol}://{username}:{password}@{git_remote}"
if os.path.exists(repo_path):
@ -50,8 +51,8 @@ class GitRepository:
def get_branches(self):
"""List all branches in the repository"""
return [branch.name for branch in self.repo.branches]
def create_branch(self, branch_name, remote_name='origin', ref_name='main'):
"""Create a new branch in the repository with authentication."""
try:
@ -61,7 +62,7 @@ class GitRepository:
except GitCommandError as e:
print(f"Failed to create branch: {e}")
return False
def add_and_commit(self, message=None):
"""Add and commit changes to the repository."""
try:
@ -77,7 +78,7 @@ class GitRepository:
except GitCommandError as e:
print(f"Commit failed: {e}")
return False
def create_copy_commit_push(self, file_path, title, commit_messge):
self.create_branch(title)
@ -88,4 +89,4 @@ class GitRepository:
self.repo.git.push(remote_name='origin', ref_name=title, force=True)
def remove_repo(self):
shutil.rmtree(self.repo_path)
shutil.rmtree(self.repo_path)