Re: [PATCH v2 16/21] bisect: make total number of commits global
From: Junio C Hamano <hidden>
Date: 2016-06-16 02:18:49
Stephan Beyer [off-list ref] writes:
The total number of commits in a bisect process is a property of the bisect process. Making this property global helps to make the code clearer. Signed-off-by: Stephan Beyer <redacted> ---
After wondring about count++ vs nr, I re-read this one. This patch is mislabled. Making it global is a lessor, supposed-to-be-no-op change, but the bigger change is that the definition of "total" is silently changed. The definition of mid-point was based on 'nr' in the original code, which counted only the tree-changing commits, and with this patch, it is based on 'total', which now only counts the tree-changing commits, so things are internally consistent, and the loop I was puzzled with, "while (counted < total)", would properly terminate. Perhaps things become cleaner and easier to understand if this was split into two steps. One that changes the meaning of 'total' (and removes 'nr'), and the other that makes 'total' a global. Thanks.