Re: query on git submodule (ignore)
On Sat, Mar 24, 2018 at 7:17 PM, prashant Nidgunde wrote: > Hello, > > I am new to this community ,so please ignore if I am asking anything silly. > > Case : > Today when I built my submodule , and did a git status , it shows as modified. > > After reading certain suggestions on web i found out that i can ignore > that adding a line in .gitmodules > > But, I had to add that line manually ( which could be errorprone > because of typos ) > > > Question: > 1. Is it feasible to build a feature like : >git submodule "zlib" ignore dirty ( which will > ignore submodule zlib when its built and dirty as it has new files in > its directory) > > If this feature is feasible , how do i know if its developed ( > awaiting merge ) or can I build the patch ? > I don't recall such a feature, but I'm sure patches to implement something would be welcome to be reviewed! (For more information about submitting patches you could read https://github.com/git/git/blob/master/Documentation/SubmittingPatches) I think having an option to automatically write this would be useful. It may already be possible to do something similar via the git config command with the -f file argument to edit the .gitmodules file (as it uses the gitconfig format for its contents). However, this is definitely not intuitive. You can read the documentation for the commands using "git help submodule" and "git help config". Patches are also definitely welcome for updates to the documentation if it's not clear. I know also that having a simpler interface to set submodules up so that they are treated as unchanged would be useful as I have projects at $dayjob which use submodules, and this is often a complaint against their use by my co-workers (who sometimes then accidentally commit re-wind updates to the submodules due to inattentiveness with use of git add . or git commit -a). Thanks, Jake
Re: [RFC][PATCH] git-stash: convert git stash list to C builtin
On Sat, Mar 24, 2018 at 2:23 PM, Paul-Sebastian Ungureanu wrote: > Currently, because git stash is not fully converted to C, I > introduced a new helper that will hold the converted commands. > --- > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > @@ -0,0 +1,52 @@ > +int cmd_stash__helper(int argc, const char **argv, const char *prefix) > +{ > + int cmdmode = 0; > + > + struct option options[] = { > + OPT_CMDMODE(0, "list", &cmdmode, > +N_("list stash entries"), LIST_STASH), > + OPT_END() > + }; Is the intention that once git-stash--helper implements all 'stash' functionality, you will simply rename git-stash--helper to git-stash? If so, then I'd think that you'd want it to accept subcommand arguments as bare words ("apply", "drop") in order to be consistent with the existing git-stash command set, not in dashed form ("--apply", "--drop"). In that case, OPT_CMDMODE doesn't seem appropriate. Instead, you should be consulting argv[] directly (as in [1]) after parse_options(). [1]: https://public-inbox.org/git/20180324173707.17699-2-j...@teichroeb.net/ > + argc = parse_options(argc, argv, prefix, options, > +git_stash__helper_usage, PARSE_OPT_KEEP_UNKNOWN); > + > + if (!cmdmode) > + usage_with_options(git_stash__helper_usage, options); > + > + switch (cmdmode) { > + case LIST_STASH: > + return list_stash(argc, argv, prefix); > + } > + return 0; > +} > diff --git a/git.c b/git.c > @@ -466,6 +466,7 @@ static struct cmd_struct commands[] = { > { "show-branch", cmd_show_branch, RUN_SETUP }, > { "show-ref", cmd_show_ref, RUN_SETUP }, > { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE }, > + { "stash--helper", cmd_stash__helper, RUN_SETUP }, You don't require a working tree? Seems odd for git-stash. > { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE }, > { "stripspace", cmd_stripspace }, > { "submodule--helper", cmd_submodule__helper, RUN_SETUP | > SUPPORT_SUPER_PREFIX},