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

Best method of detecting if list of commit refs is a parent

From
Thomas Harning Jr. <harningt@gmail.com>
Date
Aug 18, 2008, 02:24 UTC
Message-ID
<e47324780808171924j237688faj9e13740f89e75fdf@mail.gmail.com>

I'm working on my 'Stick' git bug-tracking tool and am working on the functionality to get a list of relevant bug-items at a specific point in history.

Before I get into figuring out the 'best' way to do this, I thought I'd at least get the simple single-item case of detecting if a specific commit can be walked to from another commit... and that doesn't seem to work as expected.

 git rev-list 0..Y --graph --abbrev-commit --abbrev=4
* Y
*   X
|\
| * d
| * c
| * b
* | E
* | D
* | C
* | B
|/
* A
For example... bug is reported to affect 'B'.. .user is at 'd' and is
wondering if said bug is listed as affecting him.
Command:
git rev-list B..d --graph ..  reports:
* d
* c
* b

... shouldn't this fail as the path from B to d doesn't really exist? Or is there some better command or algorithm to use. One mechanism that I thought 'could' work is to show the parents as well and check that the last listed commit contains B ... but then I can't take advantage of the no-output option for speed...

Now... into 'best method'... given a list of N revisions with associated bug-items, how would one determine the subset that revision A is affected by. Basically the bug storage mechanism is a directory structure w/ files containing bug-items that can have one or more commit references.... to facilitate faster reports, a small database is used as a caching mechanism to help create a distinct list of commits to worry about and look up all the items associated w/ the status-processed commit...

Note: bug-items can mean anything from bug reported at X, bug-status
affected by X, or bug-closed at X  (at which case any previous items
related to a given bug could be ignored and not displayed... but
that's deeper implementation...).

I intend this bug tracker to be best-suited to git... but if other bug trackers could have the mechanisms to provide this commit-tracking, then those could be dropped in... As for web interface idea... I'd probably have it "linked" to a specific branch-head for its status-tracking............

-- 
Thomas Harning Jr.
Next: Junio C Hamano
Message 1 of 4 in “Best method of detecting if list of commit refs is a parent”
  1. Thomas Harning Jr.Aug 18, 2008
  2. Junio C HamanoAug 18, 2008
  3. Thomas HarningAug 18, 2008
  4. Thomas HarningAug 23, 2008

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.