Skip to content

Commit

Permalink
status: disable deserialize when verbose output requested.
Browse files Browse the repository at this point in the history
Disable deserialization when verbose output requested.

Verbose mode causes Git to print diffs for modified files.
This requires the index to be loaded to have the currently
staged OID values.  Without loading the index, verbose output
make it look like everything was deleted.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
  • Loading branch information
jeffhostetler authored and derrickstolee committed Aug 31, 2022
1 parent e51f0ba commit a364631
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,22 @@ int cmd_status(int argc, const char **argv, const char *prefix)
*/
try_deserialize = (!do_serialize &&
(do_implicit_deserialize || do_explicit_deserialize));

/*
* Disable deserialize when verbose is set because it causes us to
* print diffs for each modified file, but that requires us to have
* the index loaded and we don't want to do that (at least not now for
* this seldom used feature). My fear is that would further tangle
* the merge conflict with upstream.
*
* TODO Reconsider this in the future.
*/
if (try_deserialize && verbose) {
trace2_data_string("status", the_repository, "deserialize/reject",
"args/verbose");
try_deserialize = 0;
}

if (try_deserialize)
goto skip_init;

Expand Down

0 comments on commit a364631

Please sign in to comment.