### Run the On-premise License Server with example values Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-license-server Start the license server container using example values: ADMIN_PASSWORD=mysecretpassword and root directory /var/syntevo-license-server. ```bash docker run \ --restart unless-stopped \ --name syntevo-license-server \ -d \ -e ADMIN_PASSWORD=mysecretpassword \ -v /var/syntevo-license-server/data:/data \ -v /var/syntevo-license-server/licenses:/licenses \ -p 8080:8080 \ ghcr.io/syntevo/license-opserver:stable ``` -------------------------------- ### Example paths for SmartGit installation and default directories Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/Company-wide-installation These paths are provided as examples in the documentation for a Linux system where the SmartGit installation directory is /opt/smartgit/ and the canonical path to the default directory is /opt/smartgit/default/. The first path is the installation directory, and the second is the default directory location. ```plain text /opt/smartgit/ ``` ```plain text /opt/smartgit/default/ ``` -------------------------------- ### Install Git LFS client Source: https://docs.syntevo.com/SmartGit/Latest/Manual/GitConcepts/GitLargeFileStorage Installs the Git LFS client on a local computer. SmartGit equivalent: Local | LFS | Install. ```bash git lfs install ``` -------------------------------- ### SmartGit startup error without GTK Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Configuration/Running-on-WSLg Example error stack trace when SmartGit fails to start because GTK is not installed. Shows UnsatisfiedLinkError for SWT library. ```text java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.syntevo.QBootLoader.main(SourceFile:115) Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: Can't load library: /home/user/.smartgit/21.2/swt.tmp/libswt-pi4-gtk-4946r10.so Can't load library: /home/user/.smartgit/21.2/swt.tmp/libswt-pi4-gtk.so Can't load library: /home/user/.smartgit/21.2/swt.tmp/libswt-pi4.so no swt-pi4-gtk-4946r10 in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib] no swt-pi4-gtk in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib] no swt-pi4 in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib] at org.eclipse.swt.internal.Library.loadLibrary(Library.java:348) at org.eclipse.swt.internal.Library.loadLibrary(Library.java:257) at org.eclipse.swt.internal.gtk.OS.(OS.java:96) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155) at org.eclipse.swt.widgets.Display.(Display.java:165) at smartgit.IV.a(SourceFile:63) at smartgit.abZ.a(SourceFile:161) at com.syntevo.smartgit.p.a(SourceFile:384) at com.syntevo.smartgit.p.a(SourceFile:283) at smartgit.acE.b(SourceFile:68) at com.syntevo.smartgit.SmartGit.main(SourceFile:11) ... 5 more ``` -------------------------------- ### Run license server with LDAP on Linux/macOS Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-license-server Docker run example for starting the on-premise license server that queries Active Directory. Single quotes are used for parameters; on Windows use double quotes. The AD server is at ldap://ad.syntevo.com on the default port. ```bash docker run --restart unless-stopped --name syntevo-license-server -d -v /var/syntevo-license-server/data:/data -v /var/syntevo-license-server/licenses:/licenses -p 8080:8080 -e LDAPACTIVE=true -e LDAPQUERY='(&(objectClass=user)(userPrincipalName={0}))' -e SPRING_LDAP_URLS=ldap://ad.syntevo.com -e SPRING_LDAP_USERNAME='uid=admin' -e SPRING_LDAP_PASSWORD=secret -e SPRING_LDAP_BASE='dc=syntevo,dc=com' ghcr.io/syntevo/license-opserver:stable ``` -------------------------------- ### Install xdg-utils for Start menu entry Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Configuration/Running-on-WSLg Install the xdg-utils package, which is required for the add-menuitem.sh script to create a Windows Start menu entry. This package is installed by default on most Linux distros but not on WSL. ```bash sudo apt install xdg-utils ``` -------------------------------- ### Example: Run Java snippet on Windows Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Debugging/Running-Java-snippets.html Concrete example for Windows using the SmartGit JRE path and a sample class name. The command runs NioFileSystemWalk with arguments and redirects output to out.txt. ```bash "C:\Program Files\SmartGit\jre\bin\java.exe" -classpath . NioFileSystemWalk "c:\temp\repo" true > out.txt ``` -------------------------------- ### Example property configuration for JSON debug directory Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Debugging/Debugging-JSON-connections Example configuration setting the debug directory to c:/temp/json. This is shown in an example callout. ```properties smartgit.json.debugDir=c:/temp/json ``` -------------------------------- ### Install SmartGit on WSLg Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Configuration/Running-on-WSLg Commands to extract SmartGit and install GTK. Replace the filename with the one you downloaded. Without GTK, SmartGit fails to start with an InvocationTargetException. ```bash cd ~ tar xvzf smartgit-linux-21_2_2.tar.gz sudo apt update sudo apt install libgtk-3-0 ``` -------------------------------- ### Install WSLg with Ubuntu Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Configuration/Running-on-WSLg Run this command in an administrator command line to install WSL with Ubuntu. Requires Win10 21H2 or later, or Win11. ```bash wsl --install -d Ubuntu ``` -------------------------------- ### Generate machine-id for SmartGit setup Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Configuration/Running-on-WSLg If SmartGit setup fails due to a missing machine-id file and sudo apt update does not resolve the problem, run this command to create the file. ```bash sudo systemd-machine-id-setup ``` -------------------------------- ### Add SmartGit to Windows Start menu Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Configuration/Running-on-WSLg Run the add-menuitem.sh script with sudo to add SmartGit to the Windows Start menu. This must be run with sudo because Windows only picks up info from system /usr/share/applications and ignores user ~/.local/share/applications. ```bash sudo ./smartgit/bin/add-menuitem.sh ``` -------------------------------- ### Example Windows control file with adjusted URL Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-update-server Example Windows control file for SmartGit 17.1.2 with adjusted sourceRootUrl. Adjust sourceRootUrl to your company-internal URL; other fields usually should not be changed. ```plaintext HEADER build=11190 minRequiredBuild=11170 versionName=17.1.2 majorName=17.1 majorDate=2017-10-12 executable32bit=bin/smartgit.exe executable64bit=bin/smartgit64.exe sourceRootUrl=http://updateserver/smartgit/updates copyPatterns=bin/*.vmoptions,.settings/*,.updates/*,unins???.dat,unins???.exe skipPatterns=lib/hgext/*.pyc CONTENT e6971f3e69c064e0468f13ae02a332b913f8e659 f changelog.txt changelog.txt ... ``` -------------------------------- ### Example smartgit.vmoptions content Source: https://docs.syntevo.com/SmartGit/Latest/Manual/GUI/AdvancedSettings/VM-options Shows the format of the smartgit.vmoptions file: each VM option must be on a separate line. This example sets the maximum heap size to 2048M and initial heap size to 1024M. ```plaintext -Xmx2048M -Xms1024M ``` -------------------------------- ### Run the On-premise License Server with placeholders Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-license-server Start the license server container with placeholders for ADMIN_PASSWORD and license-server-root. Replace and with actual values. ```bash docker run \ --restart unless-stopped \ --name syntevo-license-server \ -d \ -e ADMIN_PASSWORD= \ -v /data:/data \ -v /licenses:/licenses \ -p 8080:8080 \ ghcr.io/syntevo/license-opserver:stable ``` -------------------------------- ### Run with custom context path Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-license-server Start the license server with a custom context path /licensing and port mapping 80:8080, making it available at http://:80/licensing. ```bash docker run \ -e "SERVER_SERVLET_CONTEXT_PATH=/licensing" \ -p 80:8080 \ ghcr.io/syntevo/license-opserver:stable ``` -------------------------------- ### Print help with smartgitc.exe -? or --help Source: https://docs.syntevo.com/SmartGit/Latest/Manual/GUI/Command-Line-Options Prints all command-line options supported by the installed SmartGit version. On Windows, use smartgitc.exe (with 'c') so the output appears on the console; smartgit.exe has no effect because it is not attached to a console. ```bash smartgitc.exe -? ``` ```bash smartgitc.exe --help ``` -------------------------------- ### AddNumbers.sh - Initial Bash script for AI commenting tutorial Source: https://docs.syntevo.com/SmartGit/Latest/Manual/GUI/AI-Commenting-Tutorial Bash script that reads two numbers and outputs their sum. Used in the 'Getting Started with AI Generated Commenting' tutorial to demonstrate AI-generated commit messages. ```bash #!/bin/bash read -p "Enter first number: " num1 read -p "Enter second number: " num2 sum=$((num1 + num2)) echo "The sum is: $sum" ``` -------------------------------- ### Run license server with LDAP on Windows Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-license-server Docker run example for connecting to a local LDAP server (e.g., for testing). Uses double quotes; on Windows use single quotes. Assumes D:\license-server\.op contains data and licenses, and both containers are on the syntevo-op-server network. ```bash docker run --rm --network syntevo-op-server --name syntevo-license-server -v D:\license-server\.op\data:/data -v D:\license-server\.op\licenses:/licenses -p 8080:8080 -e LDAPACTIVE=true -e LDAPQUERY="(&(objectClass=person)(uid={0}))" -e SPRING_LDAP_URLS="ldap://syntevo-license-ldap-server:8389" -e SPRING_LDAP_USERNAME="uid=admin" -e SPRING_LDAP_PASSWORD=secret -e SPRING_LDAP_BASE="dc=springframework,dc=org" ghcr.io/syntevo/license-opserver:stable ``` -------------------------------- ### Create a bare repository with git init --bare Source: https://docs.syntevo.com/SmartGit/Latest/Manual/GUI/Repository/Synchronizing-with-Remote-Repositories Command to create a bare repository, which is recommended for receiving pushes. Bare repositories have no working tree, avoiding the push rejection error. ```bash $ git init --bare path/to/repository ``` -------------------------------- ### Create offline installation tarball Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-license-server Save the Docker image to a tarball for offline installation on a machine with access to ghcr.io. ```bash docker save -o syntevo-license-opserver.tar ghcr.io/syntevo/license-opserver:stable ``` -------------------------------- ### Install adwaita-icon-theme-full for resize cursor Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Configuration/Running-on-WSLg Install the adwaita-icon-theme-full package to fix the missing 'resize' cursor in WSLg. This applies to SmartGit 23.1 and older. ```bash sudo apt install adwaita-icon-theme-full ``` -------------------------------- ### Windows: Start SmartGit for thread dumps with bin\smartgitc.exe Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Debugging/Creating-Thread-Dumps Run SmartGit from the Windows command prompt with output redirected to dump.txt for thread dump capture. Execute this in a command prompt opened to \bin. ```batch bin\smartgitc.exe > dump.txt ``` -------------------------------- ### Invoke raw report with concrete time range Source: https://docs.syntevo.com/SmartGit/Latest/Manual/Installation/On-premise-license-server Example of a raw report request with a specific time range. The password and URL are concrete examples. ```bash curl -u admin:ebc89b1511c6eaf29921d7f9219b608e383384df3ac161287d80c39911e10eb4 "https://opserver.syntevo.com/admin/v1/reportOp?type=raw&from=2000-01-01&to=2030-12-31" ``` -------------------------------- ### Real curl command example with token and URL Source: https://docs.syntevo.com/SmartGit/Latest/HowTos/Debugging/Debugging-JSON-connections A concrete example of the curl command with a real token and URL, redirecting output to out.log and errors to err.log. ```bash curl -k -H "Authorization: token 69460770e6251fea183b229c9a89fac616c641f9" -H "Content-Type: application/json" --data @body.json https://api.github.com/repos/someone/priv/pulls > out.log 2> err.log ``` -------------------------------- ### Set settings directory to installation subdirectory (Linux) Source: https://docs.syntevo.com/SmartGit/Latest/Manual/GUI/AdvancedSettings/VM-options Add this line to smartgit.vmoptions to store SmartGit settings in the .settings subdirectory of the installation directory on Linux. Uses the smartgit.installation property. ```plaintext -Dsmartgit.settings=${smartgit.installation}/.settings ```