summaryrefslogtreecommitdiff
path: root/templates/hooks--prepare-commit-msg.sample
diff options
context:
space:
mode:
authorLibravatar Ramkumar Ramachandra <artagnon@gmail.com>2011-08-04 16:09:04 +0530
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-08-04 15:40:42 -0700
commit708f9d96d95be7e9912eea8350fdf3f04484695f (patch)
tree96fc05edc024ba41c47a994701bdb8100dac8425 /templates/hooks--prepare-commit-msg.sample
parentrevert: Rename no_replay to record_origin (diff)
downloadtgif-708f9d96d95be7e9912eea8350fdf3f04484695f.tar.xz
revert: Eliminate global "commit" variable
Functions which act on commits currently rely on a file-scope static variable to be set before they're called. Consequently, the API and corresponding callsites are ugly and unclear. Remove this variable and change their API to accept the commit to act on as additional argument so that the callsites change from looking like commit = prepare_a_commit(); act_on_commit(); to looking like commit = prepare_a_commit(); act_on_commit(commit); This change is also in line with our long-term goal of exposing some of these functions through a public API. Inspired-by: Christian Couder <chriscool@tuxfamily.org> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates/hooks--prepare-commit-msg.sample')
0 files changed, 0 insertions, 0 deletions