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

Re: [PATCH 0/2] tagsize < 8kb restriction

From
Junio C Hamano <junkio@cox.net>
Date
May 22, 2006, 19:18 UTC
Message-ID
<7vac99c1hv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<4471CF23.1070807@gmx.de>
Björn Engelmann <BjEngelmann@gmx.de> writes:
Show 7 quoted lines
> I am currently working on an interface for source code quality assurance
> tools to automatically scan newly commited code. Since it is the only
> way to add data (scan-results) to an already-existing commit, I decided
> to use tags for that.
>
> Since the scan-results will most definitly exeed the 8kb-limit, I would
> like to remove this artificial restriction.

Lifting the limit is good, but I am not sure if the use of tags for that purpose is appropriate (or any git object for that matter). I'll talk about that at the end.

Show 5 quoted lines
> What I found odd when writing the patch was that main() in mktag.c uses
> xread() to read from stdin (which respects EAGAIN and EINTR return
> values), but index_pipe() in sha1_file.c just uses read() for doing
> merely the same thing. For unifying both routines i found that xread()
> might be the better choice.
Good.
> Removing the restriction was pretty straightforward but do you think
> this would break something in other places ?
I do not think so offhand.
Now, about the usage of such a long tag for your purpose.

As you noticed, commits and tags are the only types of objetcs that can refer to other commits structurally. But there are cases where you do not even need nor want structural reference. For example, 'git cherry-pick' records the commit object name of the cherry-picked commit in the commit message as part of the text -- such a commit does not have structural reference to the original commit, and we would not _want_ one. I have a strong suspicion that your application does not need or want structural reference to commits, and it might be better to merely mention their object names as part of the text the application produces, just like what 'git cherry-pick' does.

Presumably you will have one such tag per commit, and by default 'fetch' (both cg and git) tries to follow tags, which means anybody who fetches new revision would automatically download this QA data -- that is one implication of using a tag to store this information. Without knowing the nature of it, I am not sure if everybody who tracks the source wants such baggage. If not, then use of a tag for this may not be appropriate.

Another question is if the QA data expected to be amended or annotated later, after it is created.

If the answer is yes, then you probably would not want tags -- you can create a new tag that points at the same commit to update the data, but then you have no structural relationships given by git between such tags that point at the same commit. You could infer their order by timestamp but that is about it. I think you are better off creating a separate QA project that adds one new file per commit on the main project, and have the file identify the commit object on the main project (either start your text file format for QA data with the commit object name, or name each such QA data file after the commit object name). Then your automated procedure could scan and add a new file to the QA project every time a new commit is made to the main project, and the data in the QA project can be amended or annotated and the changes will be version controlled.

If the answer is no, then it is probably better to just use an append-only log file that textually records which entry corresponds to which commit in the project. If it is not version controlled, and if it is not part of the main project, I do not see much point in putting the data under git control and in the same project.

Previous: Björn EngelmannNext: Sean
Message 2 of 12 in “tagsize < 8kb restriction”
  1. 0/2 tagsize < 8kb restrictionBjörn Engelmann, May 22, 2006
  2. Junio C HamanoMay 22, 2006
  3. SeanMay 22, 2006
  4. Linus TorvaldsMay 23, 2006
  5. SeanMay 23, 2006
  6. Björn EngelmannMay 23, 2006
  7. Junio C HamanoMay 23, 2006
  8. Björn EngelmannMay 24, 2006
  9. Junio C HamanoMay 24, 2006
  10. Björn EngelmannMay 25, 2006
  11. Junio C HamanoMay 25, 2006
  12. Junio C HamanoMay 23, 2006

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.