Re: erratic behavior commit --allow-empty
- From
PJ Weisberg <pj@irregularexpressions.net>
- Date
- Oct 3, 2012, 19:43 UTC
- Message-ID
- <CAJsNXT=Q3wOEJR6wR+e3pMM=PZLbj-9AWF+aT7i-HhkYLMOxiQ@mail.gmail.com>
- In-Reply-To
- <CAB9Jk9D5c-7QKkUFtur4rxBfiaPFzGaMi-+m=Owje_Aaoc6XJQ@mail.gmail.com>
On Wed, Oct 3, 2012 at 10:34 AM, Angelo Borsotti <angelo.borsotti@gmail.com> wrote:
Show 11 quoted lines
> HI PJ, > > take a git commit without --allow-empty: if the trees are equal, it > creates no commit, > and if the trees are different it creates one. > Take then a git commit --allow-empty: if the trees are equal it may > create a commit or > not depending on the parent, message, author and date; if the trees > are different it > creates a commit. > So, the statement does not apply to commits in general.
But that same thing applies to git commit without --allow-empty. If you create the same object twice then only one copy is stored, regardless of how you create it. In fact, the commits you were creating in your example were orphans, so --allow-empty couldn't have had an effect on them in any case.
-PJ
Gehm's Corollary to Clark's Law: Any technology distinguishable from magic is insufficiently advanced.