Re: [PATCH v2 1/5] repo-settings: consolidate some config settings
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 25, 2019, 09:30 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1907251128280.21907@tvgsbejvaqbjf.bet>
- In-Reply-To
- <597ab7d621983b5ad35006a2530aa70b452e895f.1564021392.git.gitgitgadget@gmail.com>
Hi Stolee,
On Wed, 24 Jul 2019, Derrick Stolee via GitGitGadget wrote:
Show 32 quoted lines
> diff --git a/repo-settings.h b/repo-settings.h
> new file mode 100644
> index 0000000000..89fb0159bf
> --- /dev/null
> +++ b/repo-settings.h
> @@ -0,0 +1,17 @@
> +#ifndef REPO_SETTINGS_H
> +#define REPO_SETTINGS_H
> +
> +struct repo_settings {
> + int core_commit_graph;
> + int gc_write_commit_graph;
> +
> + int index_version;
> +
> + int pack_use_sparse;
> +};
> +
> +struct repository;
> +
> +void prepare_repo_settings(struct repository *r);
> +
> +#endif /* REPO_SETTINGS_H */
> diff --git a/repository.h b/repository.h
> index 4fb6a5885f..a817486825 100644
> --- a/repository.h
> +++ b/repository.h
> @@ -2,8 +2,10 @@
> #define REPOSITORY_H
>
> #include "path.h"
> +#include "repo-settings.h"I still think that the `repo_settings` struct could just as easily be declared in `repository.h`. No need to invent a new header file.
> > struct config_set; > +struct repo_settings;
In any case, this is no longer necessary.
Show 8 quoted lines
> struct git_hash_algo;
> struct index_state;
> struct lock_file;
> @@ -72,6 +74,9 @@ struct repository {
> */
> char *submodule_prefix;
>
> + int settings_initialized;Or maybe
unsigned settings_initialized:1;
?
> + struct repo_settings settings; > +
Or maybe even fold the `initialized` flag into that struct?
Thanks, Dscho
Show 7 quoted lines
> /* Subsystems */ > /* > * Repository's config which contains key-value pairs from the usual > -- > gitgitgadget > >