SWAG >> ASX >> GIT Fact Extraction


If you intend to perform all of the steps involved in extracting facts from GIT you will need to complete the following steps on a 32 bit linux machine since asx will only currently run on such machines.

GIT fact extraction steps

The following are all of the steps needed to perform fact extraction, given that one starts with nothing.

  1. Create a suitable directory to work in.
Then either:
  1. Download the latest version of GIT from http://git-scm.com/index.html.
    Currently the latest version is git-
  2. Decompress git- using gunzip git-


  1. Download the desired version of GIT from http://www.kernel.org/pub/software/scm/git .


  1. Alternatively obtaining a copy of this decompressed file from swag:~ijdavis/git/git-
  1. Download from this webpage git-


  1. Decompress git- using tar xvf git-
  2. Create shell scripts for gcc, g++ and if desired as that capture the information about how GIT is built as described in the asx webpage. This will as a subtask involve installing of echoargs. These shell scripts and echoargs can alternatively be obtained from swag:~ijdavis/bin, and then be suitably modified to direct output to a file you may write to.
  3. Perform superficial tests to validate that your wrapping shell scripts that act as front ends to gcc, g++ and asm work.
  4. Make sure the log you are going to capture the build history into is absent or empty before each fact extraction.
  5. Build GIT by issuing the command ./make, in the git- directory and check that the build completed successfully. You might wish to capture the output from the build process itself by using the script command.
  6. Immediately rename the build log captured by the scripts that override the normal build process to history.git., (or other suitable name) so as to ensure that no further compilations are incorrectly appended to it.
  7. Check the log captured from the build process, and remove any parts of the build process not deemed relevant to the fact extraction.
  8. Download, compile and install asx, or obtain a copy of asx from "swag:~ijdavis/bin/asx".
  9. Set the asx environment variables appropriately. I used
    • ASX_IGNORE="o;a;so" to reduce some clutter in the facts otherwise extracted by asx.
    • ASX_UNLINK=no because I wanted to preserve the assembler files from which facts were actually extracted.
    • ASX_SILENT=yes because I didn't need verbose output from asx.
    • ASX_FORCE=v because I wished to include variables in the fact extraction.
  10. Run asx < history.git. > git.
  11. Check the start of the output in git. for correctness, and that the final line indicates end of output was reached.
  12. If you don't already have Sun's java installed on your machine download and install it from www.java.sun.
  13. Download and build lsedit.
  14. If running lsedit on a unix machine using X-Windows you may need to set the environment variable DISPLAY=":0.0" and then export DISPLAY, and/or use other magic in order to have LSEdit paint correctly in the display window.
  15. To view the facts extracted use:
    "java -classpath .;bunch.jar -Xms128M -Xmx1024M lsedit.LandscapeEditorFrame git.".
  16. The library bunch.jar need only be specified if you wish to use the bunch clustering facilities from within lsedit. If so you will also need to build the associated java program clue.

Viewing source code

It is possible to view the source code associated with fact extraction using LSEdit. Ideally when viewing the extracted facts source code will be located on the same path that it was found at when performing fact extraction. If the source code as consequence of having to be moved is not reachable by the paths encoded in the ta output, change the named location of the root directory by clicking on this root directory in lsedit, pressing 'a' and then alter the file field appropriately. Note that enter is required following change of a value to commit that change. You can check that the value has been changed by closing the attribute dialog box and then reopening it.

To open source code once this has been done from either an edge or a node that has file/lineno information in its attributes, go to options in the menu bar, and then Specify command. There are a number of example ways of opening up software to visualise source code (you are welcome to submit others for inclusion in the list of examples). Basically the top white line names the command to be executed, and each of the lines in the grey box specify a single parameter to this command. At run time $(X) gets changed into the value of the X attribute in the object which is selected when one invokes the command. Note that one can have more than one command by changing the hot key name in the right hand bottom corner any of (h, f4-f10). If any of the examples work for you just press set to use it. Otherwise choose the best example and then change the values in the dialog after pressing set appropriately.

Grok and JGrok

If you wish to manipulate the facts extracted you may use either grok or jgrok. Note that grok is more stable but runs only on linux platforms. JGrok should work on any machine that supports Sun Java.

Contact information

For more information on fact extraction please contact us at .