IT Conference on SAP Technologies, 2017
@LarsHvam
larshp
INVIXO.com

What is git and GitHub?


Decentralized version control system, it allows you to:
  • Compare changes over time
  • Rollback files to old version
  • Track who changed what
  • And alot more


GitHub
Hosting service for git, free for public projects.
  • Provides graphical web interface
  • Collaboration via Pull Requests

Why git and GitHub?

As of April 2017, GitHub reports having almost 20 million users and 57 million repositories.

Disclaimer

Test in sandbox
  • Open source
  • Old versions available
  • Contribute
client for ABAP
started ~3 years ago
~2000 commits
30 contributors
~53000 lines
7.02 and up
MIT License
Alexander Tsybulsky Eduardo Copat
Oliver Jägle Svitlana Shlapak
Andrei Vishnevsky Bohdan Petrushchak
Graham Robinson Gregor Wolf
Nuno Godinho Fabio Zuber
Fabian Lupa Christian Günter
Christian Tapia Sabogal Domi Bigl
Giovanni Degani Kasper Vilhelm Torp
Christian Pfaller Alex Chan
masterrx Pascal
Jakub Filak + more

Design Goals

  • Easy installation
  • Easy upgrade
  • Small system footprint
  • Code readable in git repository

Connectivity

cl_http_client=>create_by_url(
  EXPORTING
    url    = 'https://github.com'
    ssl_id = 'ANONYM'
  IMPORTING
    client = li_client ).
li_client->request->set_cdata( '' ).
li_client->request->set_header_field(
  name  = '~request_method'
  value = 'GET' ).
li_client->request->set_header_field(
  name  = 'user-agent'
  value = 'git/abapGitv1.9.7' ).
li_client->request->set_header_field(
  name  = '~request_uri'
  value = '/larshp/abapOpenChecks.git/info/refs?service=git-upload-pack' ).
li_client->send( ).
001e# service=git-upload-pack
000000fb868c5c06d2b51f6b83668f80922260f42a7ff4ca HEAD multi_ack thin-pack ...
003f868c5c06d2b51f6b83668f80922260f42a7ff4ca refs/heads/master
0040c1398119983b0ae48ec4091d9519194768a71bae refs/pull/268/head
0000

Serialization

zhello.prog.abap
REPORT zhello.

WRITE 'hello'.
zhello.prog.xml
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
 <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
  <asx:values>
   <PROGDIR>
    <NAME>ZHELLO</NAME>
    <STATE>A</STATE>
    <VARCL>X</VARCL>
    <SUBC>1</SUBC>
    <RLOAD>E</RLOAD>
    <FIXPT>X</FIXPT>
    <UCCHECK>X</UCCHECK>
   </PROGDIR>
   <TPOOL>
    <item>
     <ID>R</ID>
     <ENTRY>test</ENTRY>
     <LENGTH>4</LENGTH>
    </item>
   </TPOOL>
  </asx:values>
 </asx:abap>
</abapGit>

And deserialization

All files can be imported back into the ABAP system

Supported object types

ACID AUTH CLAS DCLS DDLS DOCT
DOCV DOMA DTEL ENHC ENHO ENHS
ENQU FUGR IARP IASP IATU MSAG
NROB PARA PINF PROG SAMC SAPC
SFBF SFBS SFSW SHI3 SHLP SICF
SPLO SSFO SSST SFPI SFPF SMIM
STYL SUSC SUSO TABL TOBJ TRAN
TTYP TYPE VCLS VIEW W3HT W3MI
WAPA WDYA WDYN WEBI XSLT + more

Github Support

The HTTP header incident
rfc2616-sec4.html#sec4.2
"Field names are case-insensitive"

The SHA1 mismatch
Git protocol: "Server and client MUST use lowercase for obj-id, both MUST treat obj-id as case-insensitive."

Features: Works With


Team Services

Features: Explore

Features: Diff

Features: Offline projects

Features: Branches

Features: Background mode

Use case: Share/Collaborate


Fork
Commit
Create Pull Request
Review
Merge
Understanding the GitHub Flow

Use case: Extra visibility/backup


abapGitServer Setup Guide



dotabap.org

Labs Preview

#ABAPisNotDead

https://larshp.github.io/Presentations/itsapcluj2017/abapgit

Contribute

http://abapgit.org

Twitter

@LarsHvam