Re: [PATCH 5/5] commit: support the --pathspec-from-file option
- From
- Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
- Date
- Nov 6, 2019, 15:56 UTC
- Message-ID
- <25aaaca1-1c88-d2c6-b502-cd35752ce745@syntevo.com>
- In-Reply-To
- <9ca7fa57-c438-7243-6ab1-956d8f132d37@gmail.com>
I think I have implemented most suggestions in PatchV2. Thanks!
> It might be worth tailoring the message to the command rather than > having exactly the same message for commit and reset
I decided to move the general comment to base commit where options are introduced and not repeat it where options are supported.
> I wonder if there is a way of calling parse_pathspec_file() from > parse_and_validate_options() instead. Otherwise we end up validating > options here instead which is a bit messy.
The code looks a bit too entangled to support that without making it worse. The biggest concern I have is that parse_and_validate_options() will populate `pathspec` and some other function will need to remember to clean it up. I like it better when `pathspec` is handled in one place.
I agree that things are not perfect, but this seems to be a consequence of other existing problems. For example, I would have expected a structure instead of a handful of global variables. That would have solved many problems. However, I didn't have the bravery to dive into this refactoring.