Skip to content

Commit fc02948

Browse files
authored
Merge pull request #138 from neel1996/v2.1.0 for release v2.1.0
# New Features - Remote repo management pane (#60) - Callout action for remote URL from repo details view (#131) - Include libgit2 bindings for all git api modules (#132) # Improvements and Bug Fixes - The backend is rewritten with libgit2 bindings which removes the dependency with the native git client (#132) - Gitconvex does not rely on native git commands to perform any git operation - libgit2 also improved the performance of most of the performance intensive operations - [reference](https://twitter.com/neeldev96/status/1350053546796871683?s=20)
2 parents 922db2a + a7fe75e commit fc02948

File tree

104 files changed

+5564
-4046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+5564
-4046
lines changed

DOCUMENTATION.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $ ./dist/gitconvex.exe
6767
![add-a-repo](https://user-images.githubusercontent.com/65342122/88536126-db9d2680-d028-11ea-890f-c5fc11cd7cf0.png)
6868

6969
- Enter repo name and paste the repo path. If the folder is not a git repo then check the "*Check this if the folder is not a git repo*" checkbox to initialize git.
70-
![repo-details](https://user-images.githubusercontent.com/65342122/101985829-556c3e80-3cb0-11eb-8449-ed9a05621c8e.png)
70+
![repo-details](https://user-images.githubusercontent.com/65342122/111644706-18bb6080-8826-11eb-9e21-d4052140b370.png)
7171

7272
- The newly added repo will be displayed as a card in the dashboard
7373
![repo-card](https://user-images.githubusercontent.com/65342122/89167157-ab113b80-d598-11ea-8985-2469e7ad261e.png)
@@ -76,6 +76,7 @@ $ ./dist/gitconvex.exe
7676
- Click on the repo card to get the following details about the repo
7777
```
7878
- The list of branches
79+
- Remote management
7980
- Commit logs
8081
- Latest commit
8182
- Active branch and available local branches
@@ -85,24 +86,30 @@ $ ./dist/gitconvex.exe
8586
The repo detail view also provides features for performing the following operations,
8687
```
8788
- Adding a new branch
89+
- Adding/Editing/Deleting a remote
8890
- Pulling changes from remote
8991
- Fetching changes from remote
90-
- Adding a new remote repo
9192
- Directory navigator to lookup all files and folders within the repo
9293
- Code view for valid files from the file explorer view
9394
- Loading commit logs dynamically
9495
```
95-
![repo-card-details](https://user-images.githubusercontent.com/65342122/103479129-82b09600-4df1-11eb-808f-9a6eba736841.png)
96+
![repo-card-details](https://user-images.githubusercontent.com/65342122/111642465-1fe16f00-8824-11eb-939a-cc52d3f0bdd4.png)
9697

9798
### Commit logs
9899

99100
- With commit log searchbar, any commit log can be looked up using its commit message or commit hash or author name who created that commit.
100101

101102
![commit-logs](https://user-images.githubusercontent.com/65342122/90782955-1723cb80-e31d-11ea-9c42-d1d5a6306e6f.png)
102103

104+
### Remote management
105+
106+
- The Remote management pane lets you add new remotes to the target repo, edit the remote URLs of the exsiting remotes and also to delete existing remotes.
107+
108+
![remote-management](https://user-images.githubusercontent.com/65342122/111649000-f6c3dd00-8829-11eb-88e7-2bd368b4dbc2.png)
109+
103110
#### List all branches
104111

105-
![branches](https://user-images.githubusercontent.com/65342122/103480861-f7d59880-4dfc-11eb-9a19-17636d111388.png)
112+
![branches](https://user-images.githubusercontent.com/65342122/111646521-bbc0aa00-8827-11eb-8d12-adae6cc455d5.png)
106113

107114
Note: In a newly initialized git repo, the newly added branch will be considered by git only after an initial commit
108115

@@ -160,4 +167,4 @@ In "Git Difference" click on the modified file to see the difference. The platfo
160167

161168
- Visit help section if you're facing an issue or need any help. If you have any queries or feedback, then discuss it in "Discord" or report an issue in GitHub.
162169
- You can check the current version of Gitconvex by clicking on the update button in this section.
163-
![help-and-support](https://user-images.githubusercontent.com/65342122/103891656-3eced100-5110-11eb-9497-3daf8d4195d2.png)
170+
![help-and-support](https://user-images.githubusercontent.com/65342122/111640522-44d4e280-8822-11eb-9c6c-0b371f99797e.png)

Dockerfile

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,61 @@
1-
FROM golang:1.15.5-alpine
1+
FROM golang:1.16.0
22

33
WORKDIR /go/src/github.com/neel1996/gitconvex-server
44

55
COPY . .
66

7-
RUN apk update && apk upgrade
8-
RUN apk add --update nodejs nodejs-npm
9-
RUN apk add git
7+
# Install required packages from apt-get
8+
RUN apt-get update && \
9+
apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget sudo -y && \
10+
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' && \
11+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
12+
apt-get install cmake -y
1013

14+
# Install node js
15+
RUN curl -fsSL https://deb.nodesource.com/setup_15.x | sudo -E bash - && \
16+
apt-get install nodejs -y
17+
18+
# Building React UI bundle
1119
RUN cd ui/ && \
1220
npm install && \
1321
export NODE_ENV=production && \
1422
npm install tailwindcss postcss autoprefixer && \
1523
npx tailwindcss build -o src/index.css -c src/tailwind.config.js && \
1624
npm run build && \
1725
mv build/ gitconvex-ui/ && \
18-
mv gitconvex-ui/ ../
26+
mv gitconvex-ui/ ../ && \
27+
cd .. && \
28+
rm -rf ui/
29+
30+
# Download and build OpenSSL
31+
RUN cd ~ && git clone https://github.com/openssl/openssl.git && \
32+
cd openssl && ./Configure && \
33+
make && make install && \
34+
cp -rp *.so* /usr/lib/
35+
36+
# Download libssh2
37+
RUN cd ~ && wget https://github.com/libssh2/libssh2/releases/download/libssh2-1.9.0/libssh2-1.9.0.tar.gz && \
38+
tar -xzf libssh2-1.9.0.tar.gz && \
39+
cd libssh2-1.9.0/ && \
40+
mkdir build && cd build && \
41+
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_INSTALL_PREFIX=../install .. && cmake --build . --target install
42+
43+
# Download and Libgit2 setup
44+
RUN cd ~ && wget https://github.com/libgit2/libgit2/releases/download/v1.1.0/libgit2-1.1.0.tar.gz && \
45+
tar -xzf libgit2-1.1.0.tar.gz && \
46+
cd libgit2-1.1.0/ && \
47+
mkdir build && cd build && \
48+
cmake -DCMAKE_PREFIX_PATH=../../libssh2-1.9.0/install/ -DCMAKE_INSTALL_PREFIX=../install -DBUILD_CLAR=OFF .. && \
49+
cmake --build . --target install && \
50+
make install && \
51+
cp -rp ~/libgit2-1.1.0/install/include/* /usr/include/ && \
52+
cp -rp ~/libgit2-1.1.0/install/lib/pkgconfig/* /usr/lib/pkgconfig && \
53+
cp -rp ~/libgit2-1.1.0/install/lib/lib* /usr/lib/
54+
55+
# Post Cleanup stage
56+
RUN apt-get remove cmake nodejs apt-transport-https ca-certificates gnupg software-properties-common wget -y
1957

2058
EXPOSE 9001
2159

22-
CMD go run /go/src/github.com/neel1996/gitconvex-server/server.go
60+
CMD export PKG_CONFIG_PATH=/usr/local/lib && \
61+
go run /go/src/github.com/neel1996/gitconvex-server/server.go

LIBGIT_NOTES.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
### Instructions to build libgit2
2+
3+
- [Windows](#for-windows)
4+
- [Linux](#for-linux-tested-on-ubuntu-2004)
5+
- [MacOS](#for-macos)
6+
7+
#### For windows
8+
9+
Make sure you have the following applications installed on your system
10+
11+
- [VS 2019](https://visualstudio.microsoft.com/vs/features/cplusplus/) for the C/C++ compiler
12+
- [cmake](https://cmake.org/download/)
13+
- [cygwin](https://www.cygwin.com/) with the following packages
14+
- [gcc](https://cygwin.com/packages/summary/mingw64-x86_64-gcc-core.html)
15+
- The package will be downloaded to `<cygwin_dir>\bin\` as `x86_64-w64-mingw32-gcc.exe`. This has to be renamed
16+
to `gcc.exe` so that go can find the package while building gitconvex with libgit2
17+
- [pkg-config](https://cygwin.com/packages/summary/pkg-config.html)
18+
- The `pkg-config` exe will be downloaded with a different name, so rename the `<cygwin_dir>\pkgconf.exe` file
19+
to `pkg-config.exe`
20+
21+
_After setting up cygwin, add cygwin /bin folder to the **path** environment variable_. Also make sure that you follow
22+
the package renaming instructions for `gcc` and `pkg-config` without fail to build or run gitconvex with libgit2
23+
24+
The libraries required for setting up `libgit2` with `libssh2` and `openssl` are available as a zip file
25+
in [lib/win](lib/win). Extract the content of the zip file into the same folder (lib/win)
26+
27+
**Steps**
28+
29+
- Download the `.zip` file from the libgit2 [releases](https://github.com/libgit2/libgit2/releases/tag/v1.1.0) or clone
30+
the [repo](https://github.com/libgit2/libgit2) from github
31+
32+
> Note : gitconvex was tested against libgit v1.1.0. So we recommend you to download the zip file from the releases section for stability
33+
34+
Extract / clone the libgit2 source to an easily accessible folder and copy the [lib](lib) folder to the root of libgit2
35+
directory
36+
37+
- Clone [libssh2](https://github.com/libssh2/libssh2) into the root of the libgit2 folder
38+
39+
```shell
40+
git clone https://github.com/libssh2/libssh2 libssh2
41+
```
42+
43+
- Search for `Cygwin64 Terminal` and open it. Run the following commands to generate the libgit2 DLL
44+
45+
```shell
46+
cd <FOLDER WHERE LIBGIT2 IS AVAILABLE>
47+
48+
mkdir build && cd build
49+
50+
cmake -DCMAKE_INSTALL_PREFIX=../install \
51+
-DOPENSSL_ROOT_DIR=../lib/win/ \
52+
-DBUILD_CLAR=OFF \
53+
-DEMBED_SSH_PATH=../libssh2 ..
54+
55+
# If the above command completes without any error, execute the following command
56+
cmake --build . --target install
57+
```
58+
59+
- After the command completes execution, the required DLL and libs for libgit2 will be available
60+
in `<libgit2_root>/install` folder
61+
- copy the `git2.dll` from `install/bin/` to `<cygwin>/bin` folder
62+
- copy `git2.lib` from `install/lib` to `<cygwin>/lib` folder
63+
- copy `libgit2.pc` from `install/lib/pkgconfig` to `<cygwin>/lib/pkgconfig`
64+
65+
Following the above steps will make `libgit2` available as a shared library for `git2go`.
66+
67+
#### For Linux (tested on Ubuntu 20.04)
68+
69+
Make sure you have the following packages installed on your system
70+
71+
- [cmake](https://cmake.org/download/)
72+
- [curl](https://curl.se/)
73+
- [wget](https://www.gnu.org/software/wget/)
74+
- [gcc](https://gcc.gnu.org/)
75+
76+
Make sure you have required rights for running the following commands. If any of these fail due to access errors, then
77+
try with `sudo`
78+
79+
```shell
80+
# Download and setup openssl
81+
cd ~ && git clone https://github.com/openssl/openssl.git openssl
82+
cd openssl && ./Configure
83+
make && make install
84+
cp -rp *.so* /usr/lib/
85+
86+
# Download and setup libssh2
87+
cd ~ && git clone https://github.com/libssh2/libssh2.git libssh2
88+
cd libssh2/
89+
mkdir build && cd build
90+
cmake -DCMAKE_INSTALL_PREFIX=../install ..
91+
cmake --build . --target install
92+
93+
#Download and setup libgit2
94+
cd ~ && wget https://github.com/libgit2/libgit2/releases/download/v1.1.0/libgit2-1.1.0.tar.gz
95+
tar -xzf libgit2-1.1.0.tar.gz
96+
cd libgit2-1.1.0/
97+
mkdir build && cd build
98+
cmake -DCMAKE_PREFIX_PATH=../../libssh2/install/ -DCMAKE_INSTALL_PREFIX=../install -DBUILD_CLAR=OFF ..
99+
cmake --build . --target install
100+
101+
# Copy the libgit2 shared object and pkconfig files to the /usr/lib path
102+
cp -rp ~/libgit2-1.1.0/install/include/* /usr/include/ && \
103+
cp -rp ~/libgit2-1.1.0/install/lib/pkgconfig/* /usr/lib/ && \
104+
cp -rp ~/libgit2-1.1.0/install/lib/lib* /usr/lib/
105+
```
106+
107+
#### For MacOS
108+
109+
The dependencies required to build and run gitconvex are readily available from `brew`
110+
111+
Download and setup [brew](https://brew.sh/) to install all the required packages
112+
113+
- [libgit2](https://formulae.brew.sh/formula/libgit2)
114+
```shell
115+
brew install libgit2
116+
```
117+
- [libssh2](https://formulae.brew.sh/formula/libssh2)
118+
```shell
119+
brew install libssh2
120+
```

LICENSE

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,7 @@
175175

176176
END OF TERMS AND CONDITIONS
177177

178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
178+
Copyright 2021 neel1996
190179

191180
Licensed under the Apache License, Version 2.0 (the "License");
192181
you may not use this file except in compliance with the License.

Makefile

Lines changed: 54 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
1-
get:
2-
go get
3-
run:
4-
go run server.go
5-
build-ui:
6-
git clone https://github.com/neel1996/gitconvex-ui.git ui/
7-
cd ui
8-
npm install
9-
npm i -g create-react-app [email protected]
10-
npm run build:tailwind
11-
npm run build
12-
mv ./build ../
13-
build-server:
14-
mkdir -p ./dist
15-
go build -o ./dist
16-
build:
17-
echo "Initiating gitconvex build"
18-
echo "Cleaning up old directories"
19-
rm -rf ui/ dist/ build/
20-
echo "Cloning gitconvex react repo"
21-
git clone https://github.com/neel1996/gitconvex-ui.git ui/ && \
22-
cd ui && \
23-
echo "Installing UI dependencies..." && \
24-
npm install && \
25-
export NODE_ENV=production && \
26-
echo "Generating production ready css" && \
27-
npm install tailwindcss postcss autoprefixer && \
28-
npx tailwindcss build -o ./src/index.css -c ./src/tailwind.config.js && \
29-
rm package-*.json && \
30-
rm -rf .git/ && \
31-
echo "Building react UI bundle" && \
32-
npm run build && \
33-
mv ./build ../ && \
34-
cd .. && \
35-
mkdir -p ./dist && \
36-
mv build/ ./dist/ && \
37-
mv ./dist/build ./dist/gitconvex-ui
38-
echo "Building final go source with UI bundle" && \
39-
go build -o ./dist && \
40-
echo "Gitconvex build completed!" && \
41-
mv ./dist/gitconvex-server ./dist/gitconvex
42-
echo "Use ./dist/gitconvex to start Gitconvex on port 9001"
43-
echo "Try ./dist/gitconvex --port PORT_NUMBER to run gitconvex on the desired port"
44-
test:
45-
go test -v ./...
46-
start:
47-
./dist/gitconvex
1+
get:
2+
go get
3+
run:
4+
go run server.go
5+
build-ui:
6+
git clone https://github.com/neel1996/gitconvex-ui.git ui/
7+
cd ui
8+
npm install
9+
export NODE_ENV=production
10+
npm i -g create-react-app [email protected]
11+
npm run build:tailwind
12+
npm run build
13+
mv ./build ../
14+
build-server:
15+
mkdir -p ./dist
16+
go build -o ./dist
17+
18+
install_deps:
19+
if [[ "$(shell uname)" == "Darwin" ]]; then cd ./lib/macos_amd64 && ./install_deps && cd .. ; else cd ./lib/linux_x86_64 && ./install_deps && cd ..; fi
20+
21+
build:
22+
@echo "⚒️ Initiating gitconvex build"
23+
@echo "🗑️ Cleaning up old directories"
24+
@rm -rf ui/ dist/ build/
25+
@echo "⏬ Cloning gitconvex react repo"
26+
@git clone -q https://github.com/neel1996/gitconvex-ui.git ui/ && \
27+
cd ui && \
28+
echo "⏳ Installing UI dependencies..." && \
29+
npm install --silent && \
30+
export NODE_ENV=production && \
31+
npm install tailwindcss postcss autoprefixer && \
32+
npx tailwindcss build -o ./src/index.css -c ./src/tailwind.config.js && \
33+
rm package-*.json && \
34+
rm -rf .git/ && \
35+
echo "🔧 Building react UI bundle" && \
36+
npm run build && \
37+
mv ./build ../ && \
38+
cd .. && \
39+
mkdir -p ./dist && \
40+
mv build/ ./dist/ && \
41+
mv ./dist/build ./dist/gitconvex-ui
42+
echo "🚀 Building final go source with UI bundle" && \
43+
go build -v -a -o ./dist && \
44+
echo "Gitconvex build completed!" && \
45+
mv ./dist/gitconvex-server ./dist/gitconvex
46+
@echo "Installing libs"
47+
$(MAKE) install_deps
48+
@echo "✅ Gitconvex Build Completed successfully!"
49+
@echo "📬 Use ./dist/gitconvex to start Gitconvex on port 9001"
50+
@echo "📬 Try ./dist/gitconvex --port PORT_NUMBER to run gitconvex on the desired port"
51+
test:
52+
go test -tags static -v ./...
53+
start:
54+
./dist/gitconvex

0 commit comments

Comments
 (0)