Commit 0b9f511
committed
Address PR review: one ListStacks per sync, command-neutral guidance
Two follow-ups from the #156 review (both flagged optional / non-blocking).
1. Remove the redundant ListStacks round-trip on sync's create path.
syncRemoteStack fetched the stack list for its already-up-to-date
short-circuit, then delegated to syncStack -> adoptRemoteStack, which
listed the stacks again — two GETs on the first-sync-create and
membership-changed paths. Refactor adoptRemoteStack into a list-accepting
reconcileUntrackedStack(cfg, client, s, prNumbers, stacks): syncStack now
fetches the list once and passes it down, and syncRemoteStack reuses the
list it already fetched. Net: exactly one ListStacks per sync. This also
drops the (handled, synced) tuple. Submit's behavior is unchanged.
2. Make the divergence / dropped-PR guidance command-neutral. The shared
helper emitted submit-specific wording ("reconcile them before
submitting", "...then `gh stack submit`") that is now reachable from
`gh stack sync`. Reword to "reconcile them first" and drop the trailing
`gh stack submit` so it reads correctly from either command.
Tests: assert exactly one ListStacks on the create path and that the
divergence guidance is not submit-specific.1 parent c3653a2 commit 0b9f511
3 files changed
Lines changed: 50 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
745 | 727 | | |
746 | 728 | | |
747 | 729 | | |
748 | 730 | | |
749 | | - | |
| 731 | + | |
750 | 732 | | |
751 | 733 | | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
752 | 750 | | |
753 | 751 | | |
754 | 752 | | |
755 | 753 | | |
756 | 754 | | |
757 | | - | |
| 755 | + | |
758 | 756 | | |
759 | 757 | | |
760 | | - | |
| 758 | + | |
761 | 759 | | |
762 | 760 | | |
763 | 761 | | |
764 | 762 | | |
765 | | - | |
| 763 | + | |
766 | 764 | | |
767 | 765 | | |
768 | 766 | | |
769 | 767 | | |
770 | 768 | | |
771 | 769 | | |
772 | 770 | | |
773 | | - | |
774 | | - | |
775 | | - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
776 | 774 | | |
777 | 775 | | |
778 | 776 | | |
| |||
782 | 780 | | |
783 | 781 | | |
784 | 782 | | |
785 | | - | |
| 783 | + | |
786 | 784 | | |
787 | 785 | | |
788 | 786 | | |
789 | | - | |
| 787 | + | |
790 | 788 | | |
791 | 789 | | |
792 | 790 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
371 | 372 | | |
372 | 373 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
| |||
384 | 388 | | |
385 | 389 | | |
386 | 390 | | |
387 | | - | |
388 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
389 | 397 | | |
390 | 398 | | |
391 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1673 | 1673 | | |
1674 | 1674 | | |
1675 | 1675 | | |
| 1676 | + | |
1676 | 1677 | | |
1677 | 1678 | | |
1678 | | - | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
1679 | 1683 | | |
1680 | 1684 | | |
1681 | 1685 | | |
| |||
1689 | 1693 | | |
1690 | 1694 | | |
1691 | 1695 | | |
| 1696 | + | |
1692 | 1697 | | |
1693 | 1698 | | |
1694 | 1699 | | |
| |||
1863 | 1868 | | |
1864 | 1869 | | |
1865 | 1870 | | |
| 1871 | + | |
1866 | 1872 | | |
1867 | 1873 | | |
1868 | 1874 | | |
0 commit comments