Re: [PATCH 05/13] revert: Eliminate global "commit" variable
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jun 21, 2011, 16:52 UTC
- Message-ID
- <20110621165233.GK15461@elie>
- In-Reply-To
- <1308661489-20080-6-git-send-email-artagnon@gmail.com>
Hi,
Ramkumar Ramachandra wrote:
> Since we want to develop the functionality to either pick or revert > individual commits atomically later in the series, make "commit" a > local variable. Doing this involves changing several functions to > take an additional argument, but no other functional changes.
Okay, one more message review. Suppose I asked you what this patch does. You'd say it makes "commit" no longer a static variable, passing it around instead. Next I ask you why. The answer would presumably be something like "because ... static variables are bad", or "because passing it around explicitly makes it easier for a person reading the code to see how the state evolves", or "because some day we will want this to be thread-safe, meaning there could be more than one commit being cherry-picked at the same time". Right?