magit-setup: define function for log history length retrieval

Change-Id: I4d5bf7016bd1da00adfbf347228396b11dac76ce