Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
fa5e232c
Commit
fa5e232c
authored
Jan 17, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
co_convert function to generate changelog texts from git log
parent
938df603
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
1 deletion
+57
-1
src/exe/co_convert/src/cnv_changelog.cpp
src/exe/co_convert/src/cnv_changelog.cpp
+47
-1
src/exe/co_convert/src/cnv_changelog.h
src/exe/co_convert/src/cnv_changelog.h
+1
-0
src/exe/co_convert/src/co_convert.cpp
src/exe/co_convert/src/co_convert.cpp
+9
-0
No files found.
src/exe/co_convert/src/cnv_changelog.cpp
View file @
fa5e232c
...
@@ -302,7 +302,7 @@ void CnvChangeLog::print_docbook()
...
@@ -302,7 +302,7 @@ void CnvChangeLog::print_docbook()
sort_time
();
sort_time
();
fp
<<
"<table xml:id=
\"
changelog_
\"
border=
\"
1
\"
><tbody>"
<<
endl
<<
fp
<<
"<table xml:id=
\"
changelog_
\"
border=
\"
1
\"
><tbody>"
<<
endl
<<
"<tr><td><classname>Date________</classname></td>"
<<
endl
<<
"<tr><td><classname>Date________
_
</classname></td>"
<<
endl
<<
"<td><classname>Module_____</classname></td>"
<<
endl
<<
"<td><classname>Module_____</classname></td>"
<<
endl
<<
"<td><classname>Change</classname></td></tr>"
<<
endl
;
"<td><classname>Change</classname></td></tr>"
<<
endl
;
...
@@ -376,4 +376,50 @@ void CnvChangeLog::print_html()
...
@@ -376,4 +376,50 @@ void CnvChangeLog::print_html()
"</html>"
<<
endl
;
"</html>"
<<
endl
;
}
}
void
CnvChangeLog
::
from_git
()
{
pwr_tFileName
tmpfile
=
"/tmp/cnv_from_git.txt"
;
pwr_tCmd
cmd
=
"git log --pretty=format:
\"
%ai
\'
%cN
\'
%s
\"
>"
;
char
line
[
1000
];
char
date
[
20
];
char
user
[
80
];
char
cuser
[
80
];
char
*
s1
,
*
s2
,
*
textp
=
0
;
strcat
(
cmd
,
tmpfile
);
system
(
cmd
);
ifstream
fp
(
tmpfile
);
while
(
fp
.
getline
(
line
,
sizeof
(
line
)))
{
date
[
0
]
=
line
[
2
];
date
[
1
]
=
line
[
3
];
date
[
2
]
=
line
[
5
];
date
[
3
]
=
line
[
6
];
date
[
4
]
=
line
[
8
];
date
[
5
]
=
line
[
9
];
date
[
6
]
=
0
;
if
(
(
s1
=
strchr
(
line
,
'\''
))
&&
(
s2
=
strchr
(
s1
+
1
,
'\''
)))
{
*
s2
=
0
;
strncpy
(
user
,
s1
+
1
,
sizeof
(
user
));
if
(
user
[
0
]
==
'R'
||
user
[
0
]
==
'r'
)
strcpy
(
cuser
,
"rk"
);
else
strcpy
(
cuser
,
"cs"
);
textp
=
s2
+
2
;
}
if
(
textp
)
printf
(
"%s %s x %s
\n
"
,
date
,
cuser
,
textp
);
}
fp
.
close
();
strcpy
(
cmd
,
"rm "
);
strcat
(
cmd
,
tmpfile
);
system
(
cmd
);
}
src/exe/co_convert/src/cnv_changelog.h
View file @
fa5e232c
...
@@ -102,6 +102,7 @@ class CnvChangeLog {
...
@@ -102,6 +102,7 @@ class CnvChangeLog {
void
sort_module
();
void
sort_module
();
void
sort_component
();
void
sort_component
();
void
sort_signature
();
void
sort_signature
();
static
void
from_git
();
};
};
#if defined __cplusplus
#if defined __cplusplus
...
...
src/exe/co_convert/src/co_convert.cpp
View file @
fa5e232c
...
@@ -83,6 +83,7 @@ static void usage()
...
@@ -83,6 +83,7 @@ static void usage()
printf
(
" -f: Create pdf from xtthelp-file
\n
"
);
printf
(
" -f: Create pdf from xtthelp-file
\n
"
);
printf
(
" -q: Create postscript from wb_load-files
\n
"
);
printf
(
" -q: Create postscript from wb_load-files
\n
"
);
printf
(
" -e: Merge changlog files to docbook file
\n
"
);
printf
(
" -e: Merge changlog files to docbook file
\n
"
);
printf
(
" -i: Convert git log to changelog format
\n
"
);
printf
(
" -a: Create xtthelp from pwg-files
\n
"
);
printf
(
" -a: Create xtthelp from pwg-files
\n
"
);
printf
(
" -d: Output directory
\n
"
);
printf
(
" -d: Output directory
\n
"
);
printf
(
" -g: Setup file
\n
"
);
printf
(
" -g: Setup file
\n
"
);
...
@@ -123,6 +124,7 @@ int main( int argc, char *argv[])
...
@@ -123,6 +124,7 @@ int main( int argc, char *argv[])
int
xtthelp_to_text
=
0
;
int
xtthelp_to_text
=
0
;
int
pwg_to_xtthelp
=
0
;
int
pwg_to_xtthelp
=
0
;
int
changelog
=
0
;
int
changelog
=
0
;
int
changelog_from_git
=
0
;
char
from
[
80
]
=
""
;
char
from
[
80
]
=
""
;
if
(
argc
<
2
||
argc
>
9
)
{
if
(
argc
<
2
||
argc
>
9
)
{
...
@@ -224,6 +226,9 @@ int main( int argc, char *argv[])
...
@@ -224,6 +226,9 @@ int main( int argc, char *argv[])
case
'e'
:
case
'e'
:
changelog
=
1
;
changelog
=
1
;
break
;
break
;
case
'i'
:
changelog_from_git
=
1
;
break
;
case
'-'
:
{
case
'-'
:
{
if
(
strcmp
(
s
,
"-from"
)
==
0
&&
(
i
+
1
<
argc
))
{
if
(
strcmp
(
s
,
"-from"
)
==
0
&&
(
i
+
1
<
argc
))
{
strcpy
(
from
,
argv
[
i
+
1
]);
strcpy
(
from
,
argv
[
i
+
1
]);
...
@@ -255,6 +260,10 @@ int main( int argc, char *argv[])
...
@@ -255,6 +260,10 @@ int main( int argc, char *argv[])
delete
c
;
delete
c
;
exit
(
0
);
exit
(
0
);
}
}
if
(
changelog_from_git
)
{
CnvChangeLog
::
from_git
();
exit
(
0
);
}
if
(
xtthelp_to_html
)
{
if
(
xtthelp_to_html
)
{
CnvXtthelpToHtml
*
xtthelpto
=
new
CnvXtthelpToHtml
(
ctx
);
CnvXtthelpToHtml
*
xtthelpto
=
new
CnvXtthelpToHtml
(
ctx
);
ctx
->
rx
=
new
CnvReadXtthelp
(
files
,
ctx
->
dir
,
xtthelpto
);
ctx
->
rx
=
new
CnvReadXtthelp
(
files
,
ctx
->
dir
,
xtthelpto
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment