git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: DEVEL: Help with feature implementation

From
Antonio Russo <aerusso@aerusso.net>
Date
Jan 19, 2021, 00:54 UTC
Message-ID
<992cd021-d6f6-dfe4-1918-45643aa85a61@aerusso.net>
In-Reply-To
<38ed4389-ba9f-743a-3fa3-5ffab12ef0a9@gmail.com>
On 1/18/21 1:58 PM, Derrick Stolee wrote:
Show 16 quoted lines
> On 1/18/2021 2:31 PM, Aiyee Bee wrote:
>> Hi Antonio and Derrick!
>>
>>> I think what you really want is --full-history --simplify-merges [1]. This
>>> will show the merges that "fork" the history into parallel tracks where
>>> at least two of them contain interesting commits.
>>
>> It doesn't look like the implementation of --simplify-merges helps much
>> here. That makes its decision on basis of the parents of the commit, which is
>> simple to do as it's information attached freely to each commit. I think the
>> problem here would be figuring out, given any commit, how many of its children
>> are "relevant" commits.
> 
> You should definitely give this a try instead of assuming things about the
> implementation. The algorithm uses a lot of "simplifying" that makes it look
> like the decision is a local one. However, I assure you that is not the case.

As a side note, would this list be willing to look at patches that remove the need to use revs->limited? Adding new features would be much easier if we could restrict git to use streaming algorithms for these simplifications.

> Please assemble a test case that demonstrates the behavior you want and how
> that is different from what is present in --simplify-merges.

I can't figure out how to get the behavior from --simplify-merges, which is described as

	Additional option to --full-history to remove some needless
	merges from  the resulting history, as there are no selected
	commits contributing to this merge.

It seems that the desired behavior is to include commits which are parents to multiple branches. Here is an example:

test_commit() {
 echo >> file
 git add file
 git commit "$@"
}

git init test_commit -m a test_commit -m b test_commit -m c git checkout -b fork test_commit -m y test_commit -m z git switch master test_commit -m d test_commit -m e test_commit -m f

git log --graph --oneline master fork
* 08029fd f
* 55b09fe e
* 83b7801 d
| * efc204e z
| * 316219e y
|/  
* 3594039 c
* 4321987 b
* bd44220 a
git log --graph --oneline --full-history --simplify-merges master fork
* 08029fd f
* 55b09fe e
* 83b7801 d
| * efc204e z
| * 316219e y
|/  
* 3594039 c
* 4321987 b
* bd44220 a
git log --graph --oneline --simplify-by-decoration --full-history --simplify-merges master fork
* 08029fd f
| * efc204e z
|/  
* bd44220 a
git log --graph --oneline --full-history --simplify-merges master fork
* 08029fd f
* 55b09fe e
* 83b7801 d
| * efc204e z
| * 316219e y
|/  
* 3594039 c
* 4321987 b
* bd44220 a

git --version git version 2.30.0

I can't seem to get commit c, the crucial fork, to show up with simplifications with this mechanism. Am I missing something here?

> 
> -Stolee
> 
Antonio
Previous: Derrick StoleeNext: Junio C Hamano
Message 9 of 16 in “DEVEL: Help with feature implementation”
  1. Aiyee BeeJan 18, 2021
  2. Antonio RussoJan 18, 2021
  3. Derrick StoleeJan 18, 2021
  4. Aiyee BeeJan 18, 2021
  5. Junio C HamanoJan 18, 2021
  6. Aiyee BeeJan 18, 2021
  7. Aiyee BeeJan 18, 2021
  8. Derrick StoleeJan 18, 2021
  9. Antonio RussoJan 19, 2021
  10. Junio C HamanoJan 19, 2021
  11. Antonio RussoJan 19, 2021
  12. Derrick StoleeJan 20, 2021
  13. Derrick StoleeJan 19, 2021
  14. Aiyee BeeJan 19, 2021
  15. Aiyee BeeJan 19, 2021
  16. Antonio RussoJan 19, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.