Unlock instant, AI-driven research and patent intelligence for your innovation.

A git-based code line life cycle tracing method and electronic device

A life cycle and code line technology, which is applied in the Git-based code line life cycle traceability method and the field of electronic devices, can solve the problems of inability to directly obtain relevant data, inability to obtain code line life cycle data, etc.

Active Publication Date: 2022-06-17
INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] When a version control system such as Git records code changes, it uses commit as the basic unit to trace the change history of the code. The commit also includes the changed code file and the changed line in the file. When a developer or researcher wants to change the code line Life cycle, that is, the process of a line of code from appearing in the code base to disappearing. When conducting research, relevant data cannot be obtained directly, that is, the life cycle data of the code line in the Git repository cannot be obtained.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A git-based code line life cycle tracing method and electronic device
  • A git-based code line life cycle tracing method and electronic device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0036] In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

[0037] like figure 1 As shown, a flowchart of steps of a Git-based code line life cycle tracing method embodiment of the present invention may include the following steps:

[0038] Step 1, extract the information of each commit in the Git repository, including the ID of the commit, the ID of the parent commit, the author, time, description of the commit, and the code change content of the commit;

[0039] Example of code changes:

[0040]

[0041] In the example, the file abc.c is changed. According to the prompt of "@@-6,5+6,6@@", the content of the file displayed thereafter is 5 consecutive lines starting from the 6th line before the change, and starting from the 6th line after the change. For 6 consecutive lines, the + s...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Git-based code line life cycle tracing method and an electronic device, which extracts the information of each commit in the Git warehouse; according to the ID of the commit and the ID of the corresponding parent commit, a directed acyclic composed of commits is established Graph, traverse the directed acyclic graph in breadth-first order, track, extract and record the change history information of the code file line according to the code change content of the commit; for a line of code to be queried in a file in a commit, according to the code file line The change history information record of the row to obtain the commit information of the generation, displacement or demise of the code to be queried. The present invention traces the code life cycle data at the line granularity, including the generation point, displacement point, and death point of the code line; it can trace back the complete change history of the code line on multiple branches; given any file in any commit snapshot Any row can directly return its full lifetime data.

Description

technical field [0001] The invention relates to the field of software code change history tracing, in particular to a Git-based code line life cycle tracing method and electronic device. Background technique [0002] Version control is an important practice method in software development. Software projects use a version control system to record the history of software code changes, including the developer, time, and content of each change. [0003] Git is currently the most popular version control system. Git uses commit to record every code change. Each commit has a unique ID. There is a parent-child relationship between commits, indicating the logical sequence of commits. These parent-child relationships will The commit links in a repository become a directed acyclic graph. [0004] The format of the code changes in Git is the same as the unified format of the diff tool in the Linux system. [0005] Version control systems such as Git use commit as the basic unit to trac...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/71
CPCG06F8/71
Inventor 朱家鑫陈伟吴国全窦文生魏峻
Owner INST OF SOFTWARE - CHINESE ACAD OF SCI