git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 01/16] submodule.h: add extern keyword to functions, break line before 80

From
Stefan Beller <sbeller@google.com>
Date
Nov 15, 2016, 23:06 UTC
Message-ID
<20161115230651.23953-2-sbeller@google.com>
In-Reply-To
<20161115230651.23953-1-sbeller@google.com>

As the upcoming series will add a lot of functions to the submodule header, it's good to start of a sane base. So format the header to not exceed 80 characters a line and mark all functions to be extern.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 submodule.h | 60 ++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 34 insertions(+), 26 deletions(-)
diff --git a/submodule.h b/submodule.h
index d9e197a..afc58d0 100644
--- a/submodule.h
+++ b/submodule.h
@@ -29,50 +29,58 @@ struct submodule_update_strategy {
 };
 #define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED, NULL}
 
-int is_staging_gitmodules_ok(void);
-int update_path_in_gitmodules(const char *oldpath, const char *newpath);
-int remove_path_from_gitmodules(const char *path);
-void stage_updated_gitmodules(void);
-void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
+extern int is_staging_gitmodules_ok(void);
+extern int update_path_in_gitmodules(const char *oldpath, const char *newpath);
+extern int remove_path_from_gitmodules(const char *path);
+extern void stage_updated_gitmodules(void);
+extern void set_diffopt_flags_from_submodule_config(
+		struct diff_options *diffopt,
 		const char *path);
-int submodule_config(const char *var, const char *value, void *cb);
-void gitmodules_config(void);
-int parse_submodule_update_strategy(const char *value,
+extern int submodule_config(const char *var, const char *value, void *cb);
+extern void gitmodules_config(void);
+extern int parse_submodule_update_strategy(const char *value,
 		struct submodule_update_strategy *dst);
-const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
-void handle_ignore_submodules_arg(struct diff_options *diffopt, const char *);
-void show_submodule_summary(FILE *f, const char *path,
+extern const char *submodule_strategy_to_string(
+		const struct submodule_update_strategy *s);
+extern void handle_ignore_submodules_arg(struct diff_options *diffopt,
+					 const char *);
+extern void show_submodule_summary(FILE *f, const char *path,
 		const char *line_prefix,
 		struct object_id *one, struct object_id *two,
 		unsigned dirty_submodule, const char *meta,
 		const char *del, const char *add, const char *reset);
-void show_submodule_inline_diff(FILE *f, const char *path,
+extern void show_submodule_inline_diff(FILE *f, const char *path,
 		const char *line_prefix,
 		struct object_id *one, struct object_id *two,
 		unsigned dirty_submodule, const char *meta,
 		const char *del, const char *add, const char *reset,
 		const struct diff_options *opt);
-void set_config_fetch_recurse_submodules(int value);
-void check_for_new_submodule_commits(unsigned char new_sha1[20]);
-int fetch_populated_submodules(const struct argv_array *options,
+extern void set_config_fetch_recurse_submodules(int value);
+extern void check_for_new_submodule_commits(unsigned char new_sha1[20]);
+extern int fetch_populated_submodules(const struct argv_array *options,
 			       const char *prefix, int command_line_option,
 			       int quiet, int max_parallel_jobs);
-unsigned is_submodule_modified(const char *path, int ignore_untracked);
-int submodule_uses_gitfile(const char *path);
-int ok_to_remove_submodule(const char *path);
-int merge_submodule(unsigned char result[20], const char *path, const unsigned char base[20],
-		    const unsigned char a[20], const unsigned char b[20], int search);
-int find_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_name,
-		struct string_list *needs_pushing);
-int push_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_name);
-void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir);
-int parallel_submodules(void);
+extern unsigned is_submodule_modified(const char *path, int ignore_untracked);
+extern int submodule_uses_gitfile(const char *path);
+extern int ok_to_remove_submodule(const char *path);
+extern int merge_submodule(unsigned char result[20], const char *path,
+			   const unsigned char base[20],
+			   const unsigned char a[20],
+			   const unsigned char b[20], int search);
+extern int find_unpushed_submodules(unsigned char new_sha1[20],
+				    const char *remotes_name,
+				    struct string_list *needs_pushing);
+extern int push_unpushed_submodules(unsigned char new_sha1[20],
+				    const char *remotes_name);
+extern void connect_work_tree_and_git_dir(const char *work_tree,
+					  const char *git_dir);
+extern int parallel_submodules(void);
 
 /*
  * Prepare the "env_array" parameter of a "struct child_process" for executing
  * a submodule by clearing any repo-specific envirionment variables, but
  * retaining any config in the environment.
  */
-void prepare_submodule_repo_env(struct argv_array *out);
+extern void prepare_submodule_repo_env(struct argv_array *out);
 
 #endif
-- 
2.10.1.469.g00a8914
Previous: Stefan BellerNext: Junio C Hamano
Message 2 of 50 in “Checkout aware of Submodules!”
  1. 00/16 Checkout aware of Submodules!Stefan Beller, Nov 15, 2016
  2. 01/16 submodule.h: add extern keyword to functions, break line before 80Stefan Beller, Nov 15, 2016
  3. Junio C HamanoNov 16, 2016
  4. Stefan BellerNov 17, 2016
  5. 06/16 update submodules: add a config option to determine if submodules are updatedStefan Beller, Nov 15, 2016
  6. 08/16 update submodules: add depopulate_submoduleStefan Beller, Nov 15, 2016
  7. Brandon WilliamsNov 15, 2016
  8. Stefan BellerNov 17, 2016
  9. Brandon WilliamsNov 17, 2016
  10. Stefan BellerNov 17, 2016
  11. Stefan BellerNov 18, 2016
  12. Brandon WilliamsNov 18, 2016
  13. Stefan BellerNov 18, 2016
  14. 11/16 teach unpack_trees() to remove submodule contentsStefan Beller, Nov 15, 2016
  15. Brandon WilliamsNov 16, 2016
  16. 09/16 update submodules: add scheduling to update submodulesStefan Beller, Nov 15, 2016
  17. Brandon WilliamsNov 16, 2016
  18. David TurnerNov 16, 2016
  19. Stefan BellerNov 18, 2016
  20. 12/16 entry: write_entry to write populate submodulesStefan Beller, Nov 15, 2016
  21. 14/16 checkout: recurse into submodules if asked toStefan Beller, Nov 15, 2016
  22. Brandon WilliamsNov 16, 2016
  23. David TurnerNov 16, 2016
  24. David TurnerNov 16, 2016
  25. 13/16 submodule: teach unpack_trees() to update submodulesStefan Beller, Nov 15, 2016
  26. David TurnerNov 16, 2016
  27. Stefan BellerNov 18, 2016
  28. David TurnerNov 21, 2016
  29. Brandon WilliamsNov 16, 2016
  30. Stefan BellerNov 18, 2016
  31. 16/16 checkout: add config option to recurse into submodules by defaultStefan Beller, Nov 15, 2016
  32. 07/16 update submodules: introduce submodule_is_interestingStefan Beller, Nov 15, 2016
  33. Brandon WilliamsNov 15, 2016
  34. David TurnerNov 16, 2016
  35. Stefan BellerNov 17, 2016
  36. 03/16 submodule: use absolute path for computing relative path connectingStefan Beller, Nov 15, 2016
  37. 04/16 update submodules: add is_submodule_populatedStefan Beller, Nov 15, 2016
  38. Brandon WilliamsNov 15, 2016
  39. 02/16 submodule: modernize ok_to_remove_submodule to use argv_arrayStefan Beller, Nov 15, 2016
  40. David TurnerNov 15, 2016
  41. Junio C HamanoNov 16, 2016
  42. Stefan BellerNov 17, 2016
  43. 10/16 update submodules: is_submodule_checkout_safeStefan Beller, Nov 15, 2016
  44. Brandon WilliamsNov 16, 2016
  45. 05/16 update submodules: add submodule config parsingStefan Beller, Nov 15, 2016
  46. 15/16 completion: add '--recurse-submodules' to checkoutStefan Beller, Nov 15, 2016
  47. Xiaodong QiDec 3, 2016
  48. Stefan BellerNov 17, 2016
  49. Stefan BellerNov 17, 2016
  50. Stefan BellerNov 18, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.