Just a minor change, the modification of new-command.txt was squashed to
2/5 instead of 1/5.
Eric Sunshine (2):
command-list: prepare machinery for upcoming "common groups" section
generate-cmdlist: parse common group commands
Sébastien Guimmara (3):
command-list.txt: add the common groups block
command-list.txt: drop the "common" tag
help: respect new common command grouping
Documentation/cmd-list.perl | 4 +++
Documentation/howto/new-command.txt | 4 ++-
Makefile | 9 ++++---
command-list.txt | 53 ++++++++++++++++++++++---------------
generate-cmdlist.perl | 50 ++++++++++++++++++++++++++++++++++
generate-cmdlist.sh | 23 ----------------
help.c | 24 ++++++++++++++++-
7 files changed, 117 insertions(+), 50 deletions(-)
create mode 100755 generate-cmdlist.perl
delete mode 100755 generate-cmdlist.sh
--
2.4.0.GIT
From: Eric Sunshine <redacted>
Parse the group block to create the array of group descriptions:
static char *common_cmd_groups[] = {
N_("starting a working area"),
N_("working on the current change"),
N_("working with others"),
N_("examining the history and state"),
N_("growing, marking and tweaking your history"),
};
then map each element of common_cmds[] to a group via its index:
static struct cmdname_help common_cmds[] = {
{"add", N_("Add file contents to the index"), 1},
{"branch", N_("List, create, or delete branches"), 4},
{"checkout", N_("Checkout a branch or paths to the ..."), 4},
{"clone", N_("Clone a repository into a new directory"), 0},
{"commit", N_("Record changes to the repository"), 4},
...
};
so that 'git help' can print those commands grouped by theme.
Only commands tagged with an attribute from the group block are emitted to
common_cmds[].
[commit message by Sébastien Guimmara [off-list ref]]
Signed-off-by: Eric Sunshine <redacted>
Signed-off-by: Sébastien Guimmara <redacted>
---
Makefile | 4 ++--
generate-cmdlist.perl | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
generate-cmdlist.sh | 23 -----------------------
3 files changed, 52 insertions(+), 25 deletions(-)
create mode 100755 generate-cmdlist.perl
delete mode 100755 generate-cmdlist.sh
The ultimate goal is for "git help" to display common commands in
groups rather than alphabetically. As a first step, define the
groups in a new block, and then assign a group to each
common command.
Add a block at the beginning of command-list.txt:
init start a working area (see also: git help tutorial)
worktree work on the current change (see also:[...]
info examine the history and state (see also: git [...]
history grow, mark and tweak your history
remote collaborate (see also: git help workflows)
storing information about common commands group, then map each common
command to a group:
git-add mainporcelain common worktree
Helped-by: Eric Sunshine [off-list ref]
Helped-by: Junio C Hamano [off-list ref]
Helped-by: Emma Jane Hogbin Westby [off-list ref]
Signed-off-by: Sébastien Guimmara <redacted>
---
Documentation/howto/new-command.txt | 4 ++-
command-list.txt | 51 ++++++++++++++++++++++---------------
2 files changed, 34 insertions(+), 21 deletions(-)
@@ -95,7 +95,9 @@ your language, document it in the INSTALL file. that categorizes commands by type, so they can be listed in appropriate subsections in the documentation's summary command list. Add an entry for yours. To understand the categories, look at git-commands.txt-in the main directory.+in the main directory. If the new command is part of the typical Git+workflow and you believe it common enough to be mentioned in 'git help',+map this command to a common group in the column [common]. 7. Give the maintainer one paragraph to include in the RelNotes file to describe the new feature; a good place to do so is in the cover
@@ -1,3 +1,14 @@+# common commands are grouped by themes+# these groups are output by 'git help' in the order declared here.+# map each common command in the command list to one of these groups.+### common groups (do not change this line)+init start a working area (see also: git help tutorial)+worktree work on the current change (see also: git help everyday)+info examine the history and state (see also: git help revisions)+history grow, mark and tweak your common history+remote collaborate (see also: git help workflows)++# List of known git commands. ### command list (do not change this line) # command name category [deprecated] [common] git-add mainporcelain common
@@ -6,24 +17,24 @@ git-annotate ancillaryinterrogators git-apply plumbingmanipulators git-archimport foreignscminterface git-archive mainporcelain-git-bisect mainporcelain common+git-bisect mainporcelain common info git-blame ancillaryinterrogators-git-branch mainporcelain common+git-branch mainporcelain common history git-bundle mainporcelain git-cat-file plumbinginterrogators git-check-attr purehelpers git-check-ignore purehelpers git-check-mailmap purehelpers-git-checkout mainporcelain common+git-checkout mainporcelain common history git-checkout-index plumbingmanipulators git-check-ref-format purehelpers git-cherry ancillaryinterrogators git-cherry-pick mainporcelain git-citool mainporcelain git-clean mainporcelain-git-clone mainporcelain common+git-clone mainporcelain common init git-column purehelpers-git-commit mainporcelain common+git-commit mainporcelain common history git-commit-tree plumbingmanipulators git-config ancillarymanipulators git-count-objects ancillaryinterrogators
command-list.sh, retired in the previous patch, was the only
consumer of the "common" tag, so drop this now-unnecessary
attribute.
before:
git-add mainporcelain common worktree
after:
git-add mainporcelain worktree
Helped-by: Eric Sunshine [off-list ref]
Signed-off-by: Sébastien Guimmara <redacted>
---
command-list.txt | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
'git help' shows common commands in alphabetical order:
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
[...]
without any indication of how commands relate to high-level
concepts or each other. Revise the output to explain their relationship
with the typical Git workflow:
The most commonly used git commands are:
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize [...]
work on the current change (see also: git help everyday)
add Add file contents to the index
reset Reset current HEAD to the specified state
examine the history and state (see also: git help revisions)
log Show commit logs
status Show the working tree status
[...]
Helped-by: Eric Sunshine [off-list ref]
Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Sébastien Guimmara <redacted>
---
help.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
@@ -218,17 +218,39 @@ void list_commands(unsigned int colopts,}}+staticintcmd_group_cmp(constvoid*elem1,constvoid*elem2)+{+conststructcmdname_help*e1=elem1;+conststructcmdname_help*e2=elem2;++if(e1->group<e2->group)+return-1;+if(e1->group>e2->group)+return1;+returnstrcmp(e1->name,e2->name);+}+voidlist_common_cmds_help(void){inti,longest=0;+intcurrent_grp=-1;for(i=0;i<ARRAY_SIZE(common_cmds);i++){if(longest<strlen(common_cmds[i].name))longest=strlen(common_cmds[i].name);}-puts(_("The most commonly used git commands are:"));+qsort(common_cmds,ARRAY_SIZE(common_cmds),+sizeof(common_cmds[0]),cmd_group_cmp);++puts(_("These are common Git commands used in various situations:"));+for(i=0;i<ARRAY_SIZE(common_cmds);i++){+if(common_cmds[i].group!=current_grp){+printf("\n%s\n",_(common_cmd_groups[common_cmds[i].group]));+current_grp=common_cmds[i].group;+}+printf(" %s ",common_cmds[i].name);mput_char(' ',longest-strlen(common_cmds[i].name));puts(_(common_cmds[i].help));
From: Eric Sunshine <redacted>
The ultimate goal is for "git help" to classify common commands by
group. Toward this end, a subsequent patch will add a new "common
groups" section to command-list.txt preceding the actual command list.
As preparation, teach existing command-list.txt parsing machinery, which
doesn't care about grouping, to skip over this upcoming "common groups"
section.
Signed-off-by: Eric Sunshine <redacted>
Signed-off-by: Sébastien Guimmara <redacted>
---
Documentation/cmd-list.perl | 4 ++++
Makefile | 5 +++--
command-list.txt | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
@@ -1,4 +1,4 @@-# List of known git commands.+### command list (do not change this line) # command name category [deprecated] [common] git-add mainporcelain common git-am mainporcelain
From: Eric Sunshine <hidden> Date: 2016-06-15 23:04:52
On Thu, May 21, 2015 at 1:39 PM, Sébastien Guimmara
[off-list ref] wrote:
quoted hunk
The ultimate goal is for "git help" to display common commands in
groups rather than alphabetically. As a first step, define the
groups in a new block, and then assign a group to each
common command.
Helped-by: Eric Sunshine [off-list ref]
Helped-by: Junio C Hamano [off-list ref]
Helped-by: Emma Jane Hogbin Westby [off-list ref]
Signed-off-by: Sébastien Guimmara <redacted>
---
@@ -1,3 +1,14 @@+# common commands are grouped by themes+# these groups are output by 'git help' in the order declared here.+# map each common command in the command list to one of these groups.+### common groups (do not change this line)+init start a working area (see also: git help tutorial)+worktree work on the current change (see also: git help everyday)+info examine the history and state (see also: git help revisions)+history grow, mark and tweak your common history+remote collaborate (see also: git help workflows)++# List of known git commands.
This is odd. The above line was removed in 1/5 but then re-appears
here in 2/5. I think the intent is that it should remain removed.
### command list (do not change this line)
# command name category [deprecated] [common]
git-add mainporcelain common
From: Eric Sunshine <hidden> Date: 2016-06-15 23:04:52
On Thu, May 21, 2015 at 1:39 PM, Sébastien Guimmara
[off-list ref] wrote:
'git help' shows common commands in alphabetical order:
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
[...]
without any indication of how commands relate to high-level
concepts or each other. Revise the output to explain their relationship
with the typical Git workflow:
The most commonly used git commands are:
The above line in the commit message does not match the actual output:
"These are common Git commands used in various situations:"
quoted hunk
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize [...]
work on the current change (see also: git help everyday)
add Add file contents to the index
reset Reset current HEAD to the specified state
examine the history and state (see also: git help revisions)
log Show commit logs
status Show the working tree status
[...]
Helped-by: Eric Sunshine [off-list ref]
Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Sébastien Guimmara <redacted>
---
@@ -218,17 +218,39 @@ void list_commands(unsigned int colopts,}}+staticintcmd_group_cmp(constvoid*elem1,constvoid*elem2)+{+conststructcmdname_help*e1=elem1;+conststructcmdname_help*e2=elem2;++if(e1->group<e2->group)+return-1;+if(e1->group>e2->group)+return1;+returnstrcmp(e1->name,e2->name);+}+voidlist_common_cmds_help(void){inti,longest=0;+intcurrent_grp=-1;for(i=0;i<ARRAY_SIZE(common_cmds);i++){if(longest<strlen(common_cmds[i].name))longest=strlen(common_cmds[i].name);}-puts(_("The most commonly used git commands are:"));+qsort(common_cmds,ARRAY_SIZE(common_cmds),+sizeof(common_cmds[0]),cmd_group_cmp);++puts(_("These are common Git commands used in various situations:"));+for(i=0;i<ARRAY_SIZE(common_cmds);i++){+if(common_cmds[i].group!=current_grp){+printf("\n%s\n",_(common_cmd_groups[common_cmds[i].group]));+current_grp=common_cmds[i].group;+}+printf(" %s ",common_cmds[i].name);mput_char(' ',longest-strlen(common_cmds[i].name));puts(_(common_cmds[i].help));--
From: Eric Sunshine <hidden> Date: 2016-06-15 23:04:52
On Thu, May 21, 2015 at 1:39 PM, Sébastien Guimmara
[off-list ref] wrote:
Just a minor change, the modification of new-command.txt was squashed to
2/5 instead of 1/5.
Thanks. With or without addressing the two very minor nits I pointed
out in patches 2/5 and 5/5, this entire patch series (v11) is:
Reviewed-by: Eric Sunshine <redacted>
Eric Sunshine (2):
command-list: prepare machinery for upcoming "common groups" section
generate-cmdlist: parse common group commands
Sébastien Guimmara (3):
command-list.txt: add the common groups block
command-list.txt: drop the "common" tag
help: respect new common command grouping
Documentation/cmd-list.perl | 4 +++
Documentation/howto/new-command.txt | 4 ++-
Makefile | 9 ++++---
command-list.txt | 53 ++++++++++++++++++++++---------------
generate-cmdlist.perl | 50 ++++++++++++++++++++++++++++++++++
generate-cmdlist.sh | 23 ----------------
help.c | 24 ++++++++++++++++-
7 files changed, 117 insertions(+), 50 deletions(-)
create mode 100755 generate-cmdlist.perl
delete mode 100755 generate-cmdlist.sh
On Thu, May 21, 2015 at 1:39 PM, Sébastien Guimmara
[off-list ref] wrote:
quoted
'git help' shows common commands in alphabetical order:
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
[...]
without any indication of how commands relate to high-level
concepts or each other. Revise the output to explain their relationship
with the typical Git workflow:
The most commonly used git commands are:
The above line in the commit message does not match the actual output:
"These are common Git commands used in various situations:"
Thanks. Will correct this.
quoted
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize [...]
work on the current change (see also: git help everyday)
add Add file contents to the index
reset Reset current HEAD to the specified state
examine the history and state (see also: git help revisions)
log Show commit logs
status Show the working tree status
[...]
Helped-by: Eric Sunshine [off-list ref]
Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Sébastien Guimmara <redacted>
---
@@ -218,17 +218,39 @@ void list_commands(unsigned int colopts,}}+staticintcmd_group_cmp(constvoid*elem1,constvoid*elem2)+{+conststructcmdname_help*e1=elem1;+conststructcmdname_help*e2=elem2;++if(e1->group<e2->group)+return-1;+if(e1->group>e2->group)+return1;+returnstrcmp(e1->name,e2->name);+}+voidlist_common_cmds_help(void){inti,longest=0;+intcurrent_grp=-1;for(i=0;i<ARRAY_SIZE(common_cmds);i++){if(longest<strlen(common_cmds[i].name))longest=strlen(common_cmds[i].name);}-puts(_("The most commonly used git commands are:"));+qsort(common_cmds,ARRAY_SIZE(common_cmds),+sizeof(common_cmds[0]),cmd_group_cmp);++puts(_("These are common Git commands used in various situations:"));+for(i=0;i<ARRAY_SIZE(common_cmds);i++){+if(common_cmds[i].group!=current_grp){+printf("\n%s\n",_(common_cmd_groups[common_cmds[i].group]));+current_grp=common_cmds[i].group;+}+printf(" %s ",common_cmds[i].name);mput_char(' ',longest-strlen(common_cmds[i].name));puts(_(common_cmds[i].help));--
On Thu, May 21, 2015 at 1:39 PM, Sébastien Guimmara
[off-list ref] wrote:
quoted
The ultimate goal is for "git help" to display common commands in
groups rather than alphabetically. As a first step, define the
groups in a new block, and then assign a group to each
common command.
Helped-by: Eric Sunshine [off-list ref]
Helped-by: Junio C Hamano [off-list ref]
Helped-by: Emma Jane Hogbin Westby [off-list ref]
Signed-off-by: Sébastien Guimmara <redacted>
---
@@ -1,3 +1,14 @@+# common commands are grouped by themes+# these groups are output by 'git help' in the order declared here.+# map each common command in the command list to one of these groups.+### common groups (do not change this line)+init start a working area (see also: git help tutorial)+worktree work on the current change (see also: git help everyday)+info examine the history and state (see also: git help revisions)+history grow, mark and tweak your common history+remote collaborate (see also: git help workflows)++# List of known git commands.
This is odd. The above line was removed in 1/5 but then re-appears
here in 2/5. I think the intent is that it should remain removed.
quoted
### command list (do not change this line)
# command name category [deprecated] [common]
git-add mainporcelain common
My mistake. This will be corrected in the next version. Thank you for taking time
to review this series.
Sébastien
From: Eric Sunshine <hidden> Date: 2016-06-15 23:04:56
[Re-sending this for on-list completeness. It was sent off-list
earlier when I was using an email client capable only of HTML
messages.]
On Mon, May 25, 2015 at 1:31 PM, Sébastien Guimmara
[off-list ref] wrote:
On 05/21/2015 08:01 PM, Eric Sunshine wrote:
quoted
On Thu, May 21, 2015 at 1:39 PM, Sébastien Guimmara
[off-list ref] wrote:
quoted
The ultimate goal is for "git help" to display common commands in
groups rather than alphabetically. As a first step, define the
groups in a new block, and then assign a group to each
common command.
Signed-off-by: Sébastien Guimmara <redacted>
---
@@ -1,3 +1,14 @@+# common commands are grouped by themes+# these groups are output by 'git help' in the order declared here.+# map each common command in the command list to one of these groups.+### common groups (do not change this line)+init start a working area (see also: git help tutorial)+worktree work on the current change (see also: git help everyday)+info examine the history and state (see also: git help
revisions)
+history grow, mark and tweak your common history
+remote collaborate (see also: git help workflows)
+
+# List of known git commands.
This is odd. The above line was removed in 1/5 but then re-appears
here in 2/5. I think the intent is that it should remain removed.
quoted
### command list (do not change this line)
# command name category [deprecated] [common]
git-add mainporcelain common
My mistake. This will be corrected in the next version. Thank you for taking
time to review this series.
Junio already made these corrections locally when he picked up the
series. Take a look at his 'pu' branch, and you'll find the series
there with the corrections[1]. Thus, no need to re-send.
[1]: Series currently merged into 'pu' at de905cf0.