diff --git a/src/ghstack/submit.py b/src/ghstack/submit.py index 6c52ff0..a01cf1f 100644 --- a/src/ghstack/submit.py +++ b/src/ghstack/submit.py @@ -2164,14 +2164,14 @@ def format_url(s: DiffMeta) -> str: if self.short: # Guarantee that the FIRST PR URL is the top of the stack - print("\n".join(format_url(s) for s in reversed(diffs_to_submit))) + print("\n".join(format_url(s) for s in diffs_to_submit)) return print() print("# Summary of changes (ghstack {})".format(ghstack.__version__)) print() if diffs_to_submit: - for s in reversed(diffs_to_submit): + for s in diffs_to_submit: url = format_url(s) print(" - {} {}".format(s.what, url)) diff --git a/test/submit/short_stack.py.test b/test/submit/short_stack.py.test new file mode 100644 index 0000000..eebedf9 --- /dev/null +++ b/test/submit/short_stack.py.test @@ -0,0 +1,15 @@ +from ghstack.test_prelude import * + +await init_test() + +await commit("A") +await commit("B") +with captured_output() as (out, err): + await gh_submit("Initial", short=True) +assert_eq( + out.getvalue(), + "https://github.com/pytorch/pytorch/pull/501\n" + "https://github.com/pytorch/pytorch/pull/500\n", +) + +ok()