Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libgit2update #153

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
048980a
Reason:
Murmele Sep 7, 2022
b8f76e1
Update build.yml and CMakeLists.txt
exactly-one-kas Sep 7, 2022
2912134
Reason:
Murmele Sep 13, 2022
4651f48
initial approach to reactivate filter apply
Murmele Sep 22, 2022
361aee9
implement filter with streams
Murmele Nov 17, 2022
ba200be
fix build
Murmele Nov 17, 2022
d1d01e9
Reason:
Murmele Nov 17, 2022
3b803a1
Fix build (at least on Windows using Clang)
exactly-one-kas Nov 17, 2022
ac6451b
comment out for now
Murmele Dec 10, 2022
a63dd88
format
Murmele Jan 12, 2023
7b53409
fix test
Murmele Jul 22, 2023
7faf33f
rename to util
Murmele Jul 22, 2023
d3432ca
abort script if any error occurs
Murmele Jul 22, 2023
0d9b9f0
format
Murmele Aug 27, 2023
556e6f0
Check if this helps
Murmele Nov 22, 2023
ebb739b
Merge remote-tracking branch 'origin/master' into libgit2update
Murmele Jun 11, 2024
d188e24
update libgit2
Murmele Jun 11, 2024
de360b9
fix compilation errors
Murmele Jun 11, 2024
f81c694
fix compilation
Murmele Jun 11, 2024
ec66c0e
use system libs
Murmele Jun 11, 2024
682123c
Update libssh2 and openssl
Murmele Jun 11, 2024
e60180d
install libssh2 and use system openssl
Murmele Jun 11, 2024
e7e27c0
cleanup
Murmele Jun 11, 2024
126ee94
missing colon
Murmele Jun 11, 2024
8169d04
libssh2 required
Murmele Jun 11, 2024
4fb03ae
install dev so that the header is available for compilation
Murmele Jun 11, 2024
19a76eb
cmake flags to enable ssh for libgit2
Murmele Jun 11, 2024
3aabc67
TESTING
Murmele Jun 11, 2024
d6ea21a
change branch back
Murmele Jun 11, 2024
ebf2b60
set to off again
Murmele Jun 11, 2024
593d791
if stashRef is invalid it should not checked further.
Murmele Jun 11, 2024
9250db7
remove USE_SSH variable, because libgit2 contains such an option
Murmele Jun 12, 2024
684d6dd
use default
Murmele Jun 15, 2024
5a074eb
patch libgit2 to support local build libssh2
Murmele Jun 15, 2024
7fa1d4b
drop win32 support
Murmele Jun 26, 2024
895b9df
cmake format
Murmele Jun 26, 2024
44456fb
update openssl to version 3.4
Murmele Sep 8, 2024
e5a0de6
Merge remote-tracking branch 'refs/remotes/origin/master'
Murmele Oct 29, 2024
496aa58
Merge remote-tracking branch 'refs/remotes/origin/master'
Murmele Nov 4, 2024
15a05c7
use system openssl for macOS
Murmele Nov 4, 2024
1121015
use correct openssl version
Murmele Nov 4, 2024
8a5f9f4
update
Murmele Jan 23, 2025
528b237
link libssh2
Murmele Jan 23, 2025
69c4000
Revert "link libssh2"
Murmele Jan 23, 2025
461e0c1
Go back to same commit as in master
Murmele Jan 28, 2025
6244628
Merge remote-tracking branch 'refs/remotes/origin/master'
Murmele Jan 28, 2025
e1cceb2
update back
Murmele Jan 28, 2025
166acbd
add change which are lost during merge
Murmele Jan 28, 2025
a4ec697
Fix dll name
Murmele Jan 28, 2025
b77d996
make use_system_... as default for qt, ssh and openssl
Murmele Jan 28, 2025
1ac0959
make installing a requirement
Murmele Jan 28, 2025
8d2bf1f
Revert "Fix dll name"
Murmele Jan 28, 2025
fb67d75
install libssh2
Murmele Jan 29, 2025
3917550
Revert "install libssh2"
Murmele Jan 29, 2025
fe8677d
update changelog
Murmele Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
qt_arch: gcc_64
openssl_arch: linux-x86_64
ld_library_arch: linux-x86-64
cmake_flags: "-DGENERATE_APPDATA=ON -DCMAKE_INSTALL_PREFIX=/usr -DUSE_SYSTEM_QT=ON -DENABLE_UPDATE_OVER_GUI=OFF"
cmake_flags: "-DGENERATE_APPDATA=ON -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_UPDATE_OVER_GUI=OFF -DUSE_SSH=ON"
pack: 0
cmake_env: {}

Expand All @@ -139,6 +139,7 @@ jobs:
ninja_platform: mac
qt_platform: mac
openssl_arch: darwin64-x86_64-cc
cmake_flags: "-DUSE_SYSTEM_LIBSSH2=OFF -DUSE_SSH:STRING=localbuild -DUSE_SYSTEM_QT=OFF"
cmake_env: {}
pack: 1

Expand All @@ -149,7 +150,7 @@ jobs:
qt_arch: win64_msvc2019_64
openssl_arch: VC-WIN64A
msvc_arch: x64
cmake_flags: "-DUSE_BUNDLED_ZLIB=1"
cmake_flags: "-DUSE_SYSTEM_QT=OFF -DUSE_SYSTEM_LIBSSH2=OFF -DUSE_BUNDLED_ZLIB=1 -DUSE_SSH:STRING=localbuild -DUSE_SYSTEM_OPENSSL=OFF"
cmake_env:
CMAKE_RC_FLAGS: "/C 1252"
CC: clang
Expand Down Expand Up @@ -181,6 +182,13 @@ jobs:
with:
perl-version: '5.30'

- name: Install Libssh2
if: matrix.env.ninja_platform == 'linux'
run: |
sudo apt-get update
sudo apt-get -y install libssh2-1
sudo apt-get -y install libssh2-1-dev

- name: Install Qt
uses: jurplel/install-qt-action@v4
timeout-minutes: 10
Expand Down Expand Up @@ -209,21 +217,6 @@ jobs:
if: matrix.env.ninja_platform == 'win'
uses: ilammy/[email protected]

- name: Build OpenSSL (Linux)
if: matrix.env.ninja_platform == 'linux'
run: |
cd dep/openssl/openssl
./config -fPIC
make

- name: Build OpenSSL (macOS)
if: matrix.env.ninja_platform == 'mac'
run: |
cd dep/openssl/openssl

./Configure ${{ matrix.env.openssl_arch }} no-shared
make

- name: Build OpenSSL (Windows)
if: matrix.env.ninja_platform == 'win'
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ build
.vscode/
CMakeLists.txt.user
cmake-build-debug/
build*
cmake-build-release/
build
.idea/
.venv
compile_commands.json
tags
.flatpak-builder
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "dep/libgit2/libgit2"]
path = dep/libgit2/libgit2
url = https://github.com/stinb/libgit2.git
url = https://github.com/Murmele/libgit2.git
[submodule "dep/libssh2/libssh2"]
path = dep/libssh2/libssh2
url = https://github.com/libssh2/libssh2.git
Expand Down
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ set(BUILD_SHARED_LIBS OFF)
option(FLATPAK "Building for flatpak" OFF)
option(DEBUG_FLATPAK "Building but using flatpak urls for testing" OFF)
option(ENABLE_UPDATE_OVER_GUI "Enable updating from the Gittyup gui" ON)
option(USE_SYSTEM_OPENSSL "Use the system-wide OpenSSL installation" OFF)
option(USE_SYSTEM_OPENSSL "Use the system-wide OpenSSL installation" ON)
option(
USE_SYSTEM_LIBGIT2
"Use the system-wide libgit2 installation (Gittyup requires the current development branch)"
OFF)
option(USE_SYSTEM_LIBSSH2 "Use the system-wide libssh2 installation" OFF)
option(USE_SYSTEM_LIBSSH2 "Use the system-wide libssh2 installation" ON)
option(USE_SYSTEM_GIT "Use the system-wide GIT installation" OFF)
option(USE_SYSTEM_QT "Don't copy QT files into the installation directory" OFF)
option(USE_SYSTEM_QT "Don't copy QT files into the installation directory" ON)
option(USE_SYSTEM_LUA "Use the system-wide Lua installation" OFF)
option(USE_SYSTEM_HUNSPELL "Use the system-wide hunspell installation" OFF)
option(USE_SYSTEM_CMARK "Use the system-wide cmark installation" OFF)
Expand All @@ -72,6 +72,10 @@ set(LUA_MODULES_PATH
"Path to the directory with native Lua modules (only relevant if system-wide Lua installation is used)"
)

if (NOT USE_SYSTEM_LIBSSH2)
set(USE_SSH "localbuild")
endif()

# Require C++17.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
Expand Down
17 changes: 16 additions & 1 deletion com.github.Murmele.Gittyup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,24 @@ modules:
- install -Dm755 $(which git-upload-archive) ${FLATPAK_DEST}/bin/
- install -Dm755 $(which git-upload-pack) ${FLATPAK_DEST}/bin/

- name: libssh2
rm-configure: true
sources:
- type: archive
url: https://www.libssh2.org/download/libssh2-1.11.0.tar.gz
sha256: 3736161e41e2693324deb38c26cfdc3efe6209d634ba4258db1cecff6a5ad461
x-checker-data:
type: anitya
project-id: 1730
url-template: https://www.libssh2.org/download/libssh2-$version.tar.gz
- type: script
commands:
- autoreconf -fiv
dest-filename: autogen.sh

- name: Gittyup
buildsystem: cmake-ninja
config-opts: [-DCMAKE_BUILD_TYPE=Release, -DFLATPAK=ON, -DGENERATE_APPDATA=ON, -DENABLE_UPDATE_OVER_GUI=OFF, -DUSE_SYSTEM_OPENSSL:BOOL=ON]
config-opts: [-DCMAKE_BUILD_TYPE=Release, -DFLATPAK=ON, -DGENERATE_APPDATA=ON, -DENABLE_UPDATE_OVER_GUI=OFF, -DUSE_SSH=ON]
builddir: true
sources:
- type: git
Expand Down
2 changes: 1 addition & 1 deletion dep/git/git
Submodule git updated 1973 files
11 changes: 4 additions & 7 deletions dep/libgit2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
set(BUILD_SHARED_LIBS
OFF
CACHE BOOL "" FORCE)
set(BUILD_CLAR
set(BUILD_TESTS
OFF
CACHE BOOL "" FORCE)
set(STATIC_CRT
OFF
CACHE BOOL "" FORCE)

# Enabled manually. Don't search for it.
set(USE_SSH
OFF
CACHE BOOL "" FORCE)

if(WIN32)
# Disable search for OpenSSL.
set(USE_OPENSSL
Expand All @@ -34,6 +29,8 @@ endif()

if(NOT USE_SYSTEM_LIBGIT2)
add_subdirectory(libgit2)

# Include the generated experimental.h
target_include_directories(
git2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libgit2/include)
libgit2 INTERFACE ${PROJECT_BINARY_DIR}/dep/libgit2/libgit2/include/git2)
endif()
2 changes: 1 addition & 1 deletion dep/libgit2/libgit2
Submodule libgit2 updated 2416 files
42 changes: 42 additions & 0 deletions dep/libgit2/rebaseGittyupLibgit2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
declare -a branches=("fetch_annotated_tags" "blame_abort" "disableRenameDetection" "checkout_deletion_notification" "diff_checkout" "fix_push_callback_issues" "disable_mmap" "context_line_accessor´" "disableRenameDetection" "hash" "callback_connect_disconnect" "libgit2_includes_public", "local_libssh2")

cd libgit2

git remote remove origin
git remote remove upstream
git remote add origin https://github.com/Murmele/libgit2.git
git remote add upstream https://github.com/libgit2/libgit2.git

git fetch --all

for branch in ${branches[@]}; do
echo $branch
git checkout -B $branch "origin/$branch"
RESULT=$?
if [ $RESULT -gt 0 ]; then
echo "Unable to checkout branch: $branch : Exitcode: $RESULT"
exit 1
fi
git rebase upstream/main
RESULT=$?
if [ $RESULT -gt 0 ]; then
echo "Unable to rebase branch: $branch : Exitcode: $RESULT"
exit 1
fi
done

git checkout Gittyup
git reset --hard upstream/main

for branch in ${branches[@]}; do
git merge --no-edit $branch
RESULT=$?
if [ $RESULT -gt 0 ]; then
echo "Unable to merge branch: $branch : Exitcode: $RESULT"
exit 1
fi
done

git push --force origin

echo "Script finished. Check if all branches are rebased correctly and push them to origin!"
2 changes: 1 addition & 1 deletion dep/libssh2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if(USE_SYSTEM_LIBSSH2)
if(PKG_CONFIG_FOUND)
pkg_check_modules(LIBSSH2 libssh2)
pkg_check_modules(LIBSSH2 REQUIRED libssh2)
endif()

else()
Expand Down
2 changes: 1 addition & 1 deletion dep/libssh2/libssh2
Submodule libssh2 updated 490 files
2 changes: 1 addition & 1 deletion dep/openssl/openssl
Submodule openssl updated 22514 files
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Bug Fix and Feature release

* Add commit filter to show only the first parent in the commit list view

#### Changed

* Use Qt6
* Update libgit2 library

----

### v1.4.0 - 2024-04-24
Expand Down
1 change: 0 additions & 1 deletion pack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ if(NOT APPLE)
WORLD_READ
WORLD_EXECUTE
COMPONENT ${GITTYUP_NAME}
OPTIONAL # if we use the system libssh, we have not built openssl
)
endforeach()
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/conf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_library(conf ConfFile.cpp Settings.cpp Setting.cpp RecentRepositories.cpp
RecentRepository.cpp)

target_link_libraries(conf lua Qt6::Core util translation)
target_link_libraries(conf lua Qt6::Core translation gittyupUtil)

# SRC_ definitions point to the source directly
target_compile_definitions(
Expand Down
3 changes: 2 additions & 1 deletion src/dialogs/SubmoduleTableModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ bool SubmoduleTableModel::setData(const QModelIndex &index,
QMessageBox::Warning, tr("Deinitialize Submodule?"), text,
QMessageBox::Cancel, qobject_cast<QWidget *>(parent()));

if (GIT_SUBMODULE_STATUS_IS_WD_DIRTY(submodule.status()))
if (GIT_SUBMODULE_STATUS_IS_WD_DIRTY(
mRepo.submoduleStatus(submodule.name())))
mb->setInformativeText(
tr("The submodule working directory contains uncommitted "
"changes that will be lost if you continue."));
Expand Down
2 changes: 1 addition & 1 deletion src/git/Branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Remote Branch::remote() const {
return up.isValid() ? up.remote() : Remote();
}

git_buf buf = GIT_BUF_INIT_CONST(nullptr, 0);
git_buf buf = GIT_BUF_INIT;
git_repository *repo = git_reference_owner(d.data());
if (git_branch_remote_name(&buf, repo, qualifiedName().toUtf8()))
return Remote();
Expand Down
6 changes: 3 additions & 3 deletions src/git/Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
//

#include "Buffer.h"
#include "git2/blob.h"

namespace git {

Buffer::Buffer(const char *data, int size)
: d(GIT_BUF_INIT_CONST(data, size)) {}
Buffer::Buffer(const char *data, int size) : data(data), size(size) {}

bool Buffer::isBinary() const { return git_buf_is_binary(&d); }
bool Buffer::isBinary() const { return git_blob_data_is_binary(data, size); }

} // namespace git
5 changes: 2 additions & 3 deletions src/git/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#ifndef BUFFER_H
#define BUFFER_H

#include "git2/buffer.h"

namespace git {

class Buffer {
Expand All @@ -21,7 +19,8 @@ class Buffer {
bool isBinary() const;

private:
git_buf d;
const char *data;
const int size;
};

} // namespace git
Expand Down
5 changes: 4 additions & 1 deletion src/git/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ add_library(
TagRef.cpp
Tree.cpp)

target_link_libraries(git git2 Qt6::Core Qt6::Network util)
# we need both libgit2package and libgit2 otherwise we can't find the header
# files
target_link_libraries(git libgit2package libgit2 gittyupUtil Qt6::Core
Qt6::Network)

set_target_properties(git PROPERTIES AUTOMOC ON)
4 changes: 2 additions & 2 deletions src/git/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ QString Config::value<QString>(const QString &key,
return defaultValue;
}

git_buf buf = GIT_BUF_INIT_CONST(nullptr, 0);
git_buf buf = GIT_BUF_INIT;
git_config_get_string_buf(&buf, d.data(), key.toUtf8());
QString value = QString::fromUtf8(buf.ptr, buf.size);
git_buf_dispose(&buf);
Expand Down Expand Up @@ -182,7 +182,7 @@ QString Config::globalPath() {
config.remove("global.force");
}

git_buf buf = GIT_BUF_INIT_CONST(nullptr, 0);
git_buf buf = GIT_BUF_INIT;
git_config_find_global(&buf);
QString path = QString::fromUtf8(buf.ptr, buf.size);
git_buf_dispose(&buf);
Expand Down
Loading
Loading