-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
submodule.h: use a named enum for RECURSE_SUBMODULES_* #1111
Conversation
/submit |
Submitted as pull.1111.git.1641410782015.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Philippe Blain wrote (reply to this):
|
User |
On the Git mailing list, Glen Choo wrote (reply to this):
|
On the Git mailing list, Glen Choo wrote (reply to this):
|
Using a named enum allows casting an integer to the enum type in both GDB and LLDB: $ gdb -q -ex 'b wt-status.c:44' -ex r --args ./git status (gdb) p (enum color_wt_status) slot $1 = WT_STATUS_ONBRANCH $ lldb -o 'b wt-status.c:44' -o r -- ./git status (lldb) p (color_wt_status) slot (color_wt_status) $0 = WT_STATUS_ONBRANCH In LLDB, it's also required to cast in the reversed direction, i.e. cast an enum constant into its corresponding integer: (lldb) p (int) color_wt_status::WT_STATUS_ONBRANCH (int) $1 = 8 Name the enum listing the different RECURSE_SUBMODULES_* modes, to make debugging easier. For example, when stepping through a part of the code where an int is compared with a constant in this enum, it allows casting the int to the enum type or vice-versa, after quickly checking where the enum constant is declared and learning the enum name. As to not make this patch a debug-only change, convert the 'fetch_recurse' member of 'struct submodule' to use the newly named enum. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
4c787d4
to
e0b211b
Compare
/submit |
Submitted as pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Glen Choo wrote (reply to this):
|
This branch is now known as |
This patch series was integrated into seen via git@c2d40f2. |
This patch series was integrated into seen via git@020bd49. |
This patch series was integrated into seen via git@1f3876b. |
This patch series was integrated into seen via git@4ab6e9c. |
This patch series was integrated into seen via git@6edfe5a. |
This patch series was integrated into seen via git@4e0f23b. |
This patch series was integrated into seen via git@64c2aa3. |
There was a status update in the "New Topics" section about the branch Small code clean-up. Will merge to 'next'? source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@897aca9. |
This patch series was integrated into seen via git@5d58e33. |
This patch series was integrated into seen via git@8d54e61. |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'next'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@4469359. |
This patch series was integrated into seen via git@bf0b4fe. |
This patch series was integrated into seen via git@5f179c7. |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'next'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'next'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@7a67800. |
This patch series was integrated into seen via git@f9fed7e. |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'next'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@817a468. |
This patch series was integrated into seen via git@eec001f. |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'next'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@cbcb30a. |
This patch series was integrated into seen via git@a1c5abf. |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'next'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@1f25dca. |
This patch series was integrated into seen via git@a991da2. |
This patch series was integrated into seen via git@571f6d1. |
This patch series was integrated into next via git@1164a4c. |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'master'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@7a62f2b. |
This patch series was integrated into seen via git@98f0418. |
There was a status update in the "Cooking" section about the branch Small code clean-up. Will merge to 'master'. source: <pull.1111.v2.git.1649092211419.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@fe12db1. |
This patch series was integrated into seen via git@24137ca. |
This patch series was integrated into seen via git@c1ff525. |
This patch series was integrated into seen via git@1f82e85. |
This patch series was integrated into seen via git@ee0241b. |
This patch series was integrated into master via git@ee0241b. |
This patch series was integrated into next via git@ee0241b. |
Closed via ee0241b. |
Changes since v1:
so the patch is not debug-only, as suggested by Glen.
a local variable being compared with an enum constant, instead of
using a struct member which is already of enum type, as pointed
out by Junio
how this patch can help when debugging.
CC: Emily Shaffer emilyshaffer@google.com
CC: Glen Choo chooglen@google.com