Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

Improve CVS Log Message Parsing + Move appending to logbuff into own function#4

Open
pkeshish wants to merge 3 commits intoandreyvit:masterfrom
pkeshish:master
Open

Improve CVS Log Message Parsing + Move appending to logbuff into own function#4
pkeshish wants to merge 3 commits intoandreyvit:masterfrom
pkeshish:master

Conversation

@pkeshish
Copy link

@pkeshish pkeshish commented Nov 4, 2017

Hello,

I have a change for CVSps to help it digest CVS log/commit messages.
I am breaking it in two different commits for better/easier review.

I am unsure if this is the de facto "upstream" CVSps repository or not. The one I initially started my work on was from OpenBSD's ports tree, which is missing some of the new changes in this repo. I'm adapting my changes to this repo, hopefully not introducing any horrible bugs.

My next commit will also updates/appends to logbuff, which is the rational for moving that bit of code into its own function made sense, instead of duplication.

--patrick

Move the "hairy" size handling of logbuff extension to append_logbuff().
Ensure logbufflen doesn't overflow SIZE_MAX (however unlikely).
Next commit will call append_logbuff() from a second area of the code.

Initializing buffers is a good thing. Especially buff, since it will
contain "stale" data (or "garbage") when cvs_rlog_fgets() only touches
it if the read message is "M " (and not during "E " or "ok" or ...).
This protects the debug() statement which follows.
Add LOGM in Valid-responses to cvs_direct. If the CVS server supports
the feature, process LOGM responses, which eliminate all guess-work of
parsing log/commit messages, which may contain file/revision boundaries.

NOTE: LOGM patch has been proposed to CVS upstream and Thorsten Glaser
has conveyed a favorable initial response.

Second change is to add line count to "Log:" tag in PatchSets, this will
in turn help Git-cvsimport (proposed patch) to known number of log/commit
message lines to extract following the "Log:" tag. This will prevent
Git-cvsimport from getting confused if the log/commit message contains
lines starting with "Members:", for example.

Abstracting away the open/close/fgets from cvs_direct or file/pipe is
just a bonus.
@pkeshish
Copy link
Author

pkeshish commented Nov 4, 2017

Just for reference, my proposal to CVS to include MLOG response can be found here:
http://lists.nongnu.org/archive/html/info-cvs/2017-11/msg00000.html

A link to what/why took me down this path: http://sidster.com/code/cvs2git/

@pkeshish pkeshish changed the title Move appending to logbuff into own function Improve CVS Log Message Parsing + Move appending to logbuff into own function Nov 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant