Commit e4f8baa
subtree: parse revs in individual cmd_ functions
The main argument parser goes ahead and tries to parse revs to make
things simpler for the sub-command implementations. But, it includes
enough special cases for different sub-commands. And it's difficult
having having to think about "is this info coming from an argument, or a
global variable?". So the main argument parser's effort to make things
"simpler" ends up just making it more confusing and complicated.
Begone with the 'revs' global variable; parse 'rev=$(...)' as needed in
individual 'cmd_*' functions.
Begone with the 'default' global variable. Its would-be value is
knowable just from which function we're in.
Begone with the 'ensure_single_rev' function. Its functionality can be
achieved by passing '--verify' to 'git rev-parse'.
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent bbffb02 commit e4f8baa
1 file changed
+24
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 79 | | |
87 | 80 | | |
88 | 81 | | |
| |||
164 | 157 | | |
165 | 158 | | |
166 | 159 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 160 | + | |
| 161 | + | |
172 | 162 | | |
173 | 163 | | |
174 | 164 | | |
| |||
193 | 183 | | |
194 | 184 | | |
195 | 185 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | 186 | | |
210 | 187 | | |
211 | | - | |
212 | 188 | | |
213 | 189 | | |
214 | 190 | | |
| |||
714 | 690 | | |
715 | 691 | | |
716 | 692 | | |
717 | | - | |
718 | | - | |
719 | | - | |
| 693 | + | |
720 | 694 | | |
721 | 695 | | |
722 | 696 | | |
723 | | - | |
724 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
725 | 700 | | |
726 | 701 | | |
727 | 702 | | |
| |||
752 | 727 | | |
753 | 728 | | |
754 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
755 | 741 | | |
756 | 742 | | |
757 | 743 | | |
| |||
768 | 754 | | |
769 | 755 | | |
770 | 756 | | |
771 | | - | |
| 757 | + | |
772 | 758 | | |
773 | 759 | | |
774 | 760 | | |
775 | 761 | | |
776 | | - | |
| 762 | + | |
777 | 763 | | |
778 | 764 | | |
779 | 765 | | |
| |||
820 | 806 | | |
821 | 807 | | |
822 | 808 | | |
823 | | - | |
824 | | - | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
825 | 813 | | |
826 | 814 | | |
827 | 815 | | |
| |||
861 | 849 | | |
862 | 850 | | |
863 | 851 | | |
864 | | - | |
865 | | - | |
866 | | - | |
| 852 | + | |
867 | 853 | | |
868 | 854 | | |
869 | 855 | | |
| |||
0 commit comments