From af53e8ce931397eec57ce6018a9a750b95cedcb4 Mon Sep 17 00:00:00 2001 From: "Trent Robbins (aider)" Date: Sun, 27 Apr 2025 12:53:22 -0700 Subject: [PATCH] refactor: rename install_main_branch to install_branch --- aider/main.py | 14 +++++++------- aider/versioncheck.py | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/aider/main.py b/aider/main.py index 51a565b55..5290d8f94 100644 --- a/aider/main.py +++ b/aider/main.py @@ -33,7 +33,7 @@ from aider.models import ModelSettings from aider.onboarding import offer_openrouter_oauth, select_default_model from aider.repo import ANY_GIT_ERROR, GitRepo from aider.report import report_uncaught_exceptions -from aider.versioncheck import check_version, install_from_main_branch, install_upgrade +from aider.versioncheck import check_version, install_from_git_branch, install_upgrade from aider.watch import FileWatcher from .dump import dump # noqa: F401 @@ -712,13 +712,13 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F analytics.event("exit", reason="Just checking update") return 0 if not update_available else 1 - # Handle --install-main-branch [url] - if args.install_main_branch: - if isinstance(args.install_main_branch, str): - success = install_from_main_branch(io, remote_url=args.install_main_branch) + # Handle --install-branch [url] + if args.install_branch: + if isinstance(args.install_branch, str): + success = install_from_git_branch(io, remote_url=args.install_branch) else: # True, meaning the flag was used without a URL - success = install_from_main_branch(io) - analytics.event("exit", reason="Installed main branch") + success = install_from_git_branch(io) + analytics.event("exit", reason="Installed git branch") return 0 if success else 1 if args.upgrade: diff --git a/aider/versioncheck.py b/aider/versioncheck.py index ad67a3d6a..b350614f9 100644 --- a/aider/versioncheck.py +++ b/aider/versioncheck.py @@ -12,14 +12,15 @@ from aider.dump import dump # noqa: F401 VERSION_CHECK_FNAME = Path.home() / ".aider" / "caches" / "versioncheck" -def install_from_main_branch(io, remote_url=None): +def install_from_git_branch(io, remote_url=None): """ - Install the latest version of aider from the main branch of the GitHub repository. + Install the latest version of aider from the main branch of the GitHub repository + or a specified git remote URL. """ if remote_url is None: - remote_url = "git+https://github.com/Aider-AI/aider.git" - source_description = "the main branch" + remote_url = "git+https://github.com/Aider-AI/aider.git@main" + source_description = "the Aider-AI main branch" else: source_description = remote_url