Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check .github/ghstack_direct to decide if using direct by default #258

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update
[ghstack-poisoned]
ezyang committed Aug 10, 2024
commit 76d2812076fb21c82b4c96198158fce7b309d457
Empty file added .github/ghstack_direct
Empty file.
9 changes: 8 additions & 1 deletion ghstack/submit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3

Check warning on line 1 in ghstack/submit.py

GitHub Actions / lint (3.11, ubuntu-latest)

UFMT format

Run `lintrunner -a` to apply this patch.

import dataclasses
import itertools
@@ -406,7 +406,14 @@
default_branch = repo["default_branch"]

object.__setattr__(self, "base", default_branch)
object.__setattr__(self, "direct", bool(self.direct_opt))

# Check if direct should be used, if the user didn't explicitly
# specify an option
direct = self.direct_opt
if direct is None:
direct = self.sh.git("cat-file", "-e", "HEAD:.github/ghstack_direct", exitcode=True)

object.__setattr__(self, "direct", direct)

# ~~~~~~~~~~~~~~~~~~~~~~~~
# The main algorithm