Skip to content

cleaner bit-setting in cmd_push

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cmd_push: set "atomic" bit directlybuiltin/push.c+1 -50 replies
2/3cmd_push: pass "flags" pointer to config callbackbuiltin/push.c+1 -12 replies
3/3push: allow --follow-tags to be set by config push.followTagsDocumentation/config.txt Documentation/git-push.txt builtin/push.c +1 more+20 -14 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] cleaner bit-setting in cmd_push
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Jeff King

Or alternatively, we could pull the "flags" field from cmd_push out into a static global "transport_flags", and manipulate it directly from the config (or if we don't like a global, pass it via the config-callback void pointer; but certainly a global is more common in git for code like this). Then we do not have to worry about propagating values from integers into flag bits at all.

Quoted 6 lines

Yup, that would be my preference. The largest problem I had with the original change was how to ensure that future new code would not mistakenly set the global follow_tags _without_ letting the command line option parser to override it. If the config parser flips the bit in the same flags, it would become much less likely for future code to make such a mistake.

So here's my take on it (on top of the two-patch series I just sent). Dave's patch is 3rd here, just to show its rebased form, but do not take that as a final endorsement. I still think it could use tests, but I will let him write them. I am just doing the cleanup in the area, none of which needs to be his problem. :)

[1/3]: cmd_push: set "atomic" bit directly
[2/3]: cmd_push: pass "flags" pointer to config callback [3/3]: push: allow --follow-tags to be set by config push.followTags

-Peff