├── .editorconfig ├── .gitlab-ci.yml ├── .gitlab └── ISSUE_TEMPLATE_USABILITY_TEST.md ├── AUTHORS ├── CONTRIBUTING.md ├── COPYING ├── ChangeLog ├── NEWS ├── PACKAGING ├── README.md ├── contrib ├── ide │ ├── ide-doap-person.c │ ├── ide-doap-person.h │ ├── ide-doap.c │ ├── ide-doap.h │ ├── ide.h │ ├── ide.vapi │ └── meson.build └── xml │ ├── meson.build │ ├── xml-reader.c │ └── xml-reader.h ├── data ├── gitg-glade.xml ├── gitg.1 ├── icons │ ├── meson.build │ ├── org.gnome.gitg-symbolic.svg │ ├── org.gnome.gitg.svg │ └── org.gnome.gitgDevel.svg ├── meson.build ├── org.gnome.gitg.appdata.xml.in.in ├── org.gnome.gitg.desktop.in.in ├── org.gnome.gitg.gschema.xml.in └── screenshots │ ├── commit.png │ ├── history.png │ ├── projects.png │ └── stage.png ├── gitg.doap ├── gitg ├── commit │ ├── TODO.md │ ├── gitg-commit-dialog.vala │ ├── gitg-commit-paned.vala │ ├── gitg-commit-sidebar.vala │ ├── gitg-commit-submodule-diff-view.vala │ ├── gitg-commit-submodule-history-view.vala │ ├── gitg-commit-submodule-info.vala │ └── gitg-commit.vala ├── gitg-action-support.vala ├── gitg-add-remote-action-dialog.vala ├── gitg-add-remote-action.vala ├── gitg-animated-paned.vala ├── gitg-application.vala ├── gitg-author-details-dialog.vala ├── gitg-builder.vala ├── gitg-checkout-remote-branch-dialog.vala ├── gitg-clone-dialog.vala ├── gitg-commit-action-cherry-pick.vala ├── gitg-commit-action-create-branch.vala ├── gitg-commit-action-create-patch.vala ├── gitg-commit-action-create-tag.vala ├── gitg-convert.vala ├── gitg-create-branch-dialog.vala ├── gitg-create-tag-dialog.vala ├── gitg-dash-view.vala ├── gitg-dirs.vala ├── gitg-edit-remote-action.vala ├── gitg-edit-remote-dialog.vala ├── gitg-notifications.vala ├── gitg-plugins-engine.vala ├── gitg-popup-menu.vala ├── gitg-recursive-monitor.vala ├── gitg-recursive-scanner.vala ├── gitg-ref-action-checkout.vala ├── gitg-ref-action-copy-name.vala ├── gitg-ref-action-create-branch.vala ├── gitg-ref-action-create-patch.vala ├── gitg-ref-action-create-tag.vala ├── gitg-ref-action-delete.vala ├── gitg-ref-action-fetch.vala ├── gitg-ref-action-merge.vala ├── gitg-ref-action-push.vala ├── gitg-ref-action-rename.vala ├── gitg-ref-action-tag-info.vala ├── gitg-remote-fetch-all-action.vala ├── gitg-remote-manager.vala ├── gitg-remote-notification.vala ├── gitg-remove-remote-action.vala ├── gitg-simple-notification.vala ├── gitg-tag-show-info-dialog.vala ├── gitg-ui-elements.vala ├── gitg-window.vala ├── gitg.rc ├── gitg.vala ├── history │ ├── gitg-history-action-interface.vala │ ├── gitg-history-command-line.vala │ ├── gitg-history-paned.vala │ ├── gitg-history-refs-list.vala │ └── gitg-history.vala ├── meson.build ├── preferences │ ├── gitg-preferences-commit.vala │ ├── gitg-preferences-dialog.vala │ ├── gitg-preferences-history.vala │ └── gitg-preferences-interface.vala └── resources │ ├── gitg-resources.xml.in │ ├── pixmaps │ └── gitg.ico │ └── ui │ ├── gitg-add-remote-action-dialog.ui │ ├── gitg-author-details-dialog.ui │ ├── gitg-checkout-remote-branch-dialog.ui │ ├── gitg-clone-dialog.ui │ ├── gitg-commit-dialog.ui │ ├── gitg-commit-paned.ui │ ├── gitg-commit-submodule-diff-view.ui │ ├── gitg-commit-submodule-history-view.ui │ ├── gitg-commit-submodule-info.ui │ ├── gitg-create-branch-dialog.ui │ ├── gitg-create-tag-dialog.ui │ ├── gitg-dash-view.ui │ ├── gitg-edit-remote-dialog.ui │ ├── gitg-history-paned.ui │ ├── gitg-history-ref-header.ui │ ├── gitg-history-ref-row.ui │ ├── gitg-menus.ui │ ├── gitg-preferences-commit.ui │ ├── gitg-preferences-history.ui │ ├── gitg-preferences-interface.ui │ ├── gitg-preferences.ui │ ├── gitg-remote-notification.ui │ ├── gitg-shortcuts.ui │ ├── gitg-simple-notification.ui │ ├── gitg-tag-show-info-dialog.ui │ ├── gitg-window.ui │ ├── style-osx.css │ ├── style-unix.css │ ├── style-win32.css │ └── style.css ├── libgitg-ext ├── GitgExt.py ├── gitg-ext-action.vala ├── gitg-ext-activity.vala ├── gitg-ext-application.vala ├── gitg-ext-assembly-info.vala ├── gitg-ext-command-line.vala ├── gitg-ext-command-lines.vala ├── gitg-ext-commit-action.vala ├── gitg-ext-history-panel.vala ├── gitg-ext-history.vala ├── gitg-ext-message-bus.vala ├── gitg-ext-message-id.vala ├── gitg-ext-message.vala ├── gitg-ext-notification.vala ├── gitg-ext-notifications.vala ├── gitg-ext-preferences.vala ├── gitg-ext-ref-action-interface.vala ├── gitg-ext-ref-action.vala ├── gitg-ext-remote-lookup.vala ├── gitg-ext-searchable.vala ├── gitg-ext-selectable.vala ├── gitg-ext-ui-element.vala ├── gitg-ext-ui.vala ├── gitg-ext-user-query.vala ├── meson.build └── resources │ └── resources.xml ├── libgitg.map ├── libgitg ├── gitg-assembly-info.vala ├── gitg-async.vala ├── gitg-authentication-dialog.vala ├── gitg-avatar-cache.vala ├── gitg-branch-base.vala ├── gitg-branch.vala ├── gitg-cell-renderer-lanes.vala ├── gitg-color.vala ├── gitg-commit-list-view.vala ├── gitg-commit-model.vala ├── gitg-commit.vala ├── gitg-credentials-manager.vala ├── gitg-date.vala ├── gitg-diff-image-composite.vala ├── gitg-diff-image-difference.vala ├── gitg-diff-image-overlay.vala ├── gitg-diff-image-side-by-side.vala ├── gitg-diff-image-slider.vala ├── gitg-diff-image-surface-cache.vala ├── gitg-diff-selectable.vala ├── gitg-diff-stat.vala ├── gitg-diff-view-commit-details.vala ├── gitg-diff-view-file-info.vala ├── gitg-diff-view-file-renderer-binary.vala ├── gitg-diff-view-file-renderer-image.vala ├── gitg-diff-view-file-renderer-text-split.vala ├── gitg-diff-view-file-renderer-text.vala ├── gitg-diff-view-file-renderer-textable.vala ├── gitg-diff-view-file-renderer.vala ├── gitg-diff-view-file-selectable.vala ├── gitg-diff-view-file.vala ├── gitg-diff-view-lines-renderer.vala ├── gitg-diff-view-options.vala ├── gitg-diff-view.vala ├── gitg-font-manager.vala ├── gitg-gpg-utils.vala ├── gitg-hook.vala ├── gitg-init.vala ├── gitg-label-renderer.vala ├── gitg-lane.vala ├── gitg-lanes.vala ├── gitg-platform-support-osx.c ├── gitg-platform-support-win32.c ├── gitg-platform-support.c ├── gitg-platform-support.h ├── gitg-progress-bin.vala ├── gitg-ref-base.vala ├── gitg-ref.vala ├── gitg-remote.vala ├── gitg-repository-list-box.vala ├── gitg-repository.vala ├── gitg-resource.vala ├── gitg-sidebar.vala ├── gitg-stage-status-enumerator.vala ├── gitg-stage.vala ├── gitg-textconv.vala ├── gitg-theme.vala ├── gitg-utils.vala ├── gitg-when-mapped.vala ├── meson.build └── resources │ ├── resources.xml │ └── ui │ ├── gitg-authentication-dialog.ui │ ├── gitg-diff-view-commit-details.ui │ ├── gitg-diff-view-file-renderer-binary.ui │ ├── gitg-diff-view-file-renderer-image.ui │ ├── gitg-diff-view-file-renderer-text-split.ui │ ├── gitg-diff-view-file-renderer-text.ui │ ├── gitg-diff-view-file.ui │ ├── gitg-diff-view-options-spacing.ui │ ├── gitg-diff-view-options.ui │ ├── gitg-diff-view.ui │ ├── gitg-repository-list-box-row.ui │ ├── gitg-sidebar.ui │ └── libgitg-style.css ├── meson.build ├── meson_options.txt ├── meson_post_install.py ├── org.gnome.gitgDevel.json ├── osx ├── .gitignore ├── Taps │ └── gitg │ │ ├── atk.rb │ │ ├── cairo.rb │ │ ├── enchant.rb │ │ ├── gdk-pixbuf.rb │ │ ├── gitg.rb │ │ ├── glib-networking.rb │ │ ├── glib.rb │ │ ├── gnome-icon-theme.rb │ │ ├── gnutls.rb │ │ ├── gobject-introspection.rb │ │ ├── gsettings-desktop-schemas.rb │ │ ├── gspell.rb │ │ ├── gtk+3.rb │ │ ├── gtk-doc.rb │ │ ├── gtksourceview3.rb │ │ ├── harfbuzz.rb │ │ ├── libcroco.rb │ │ ├── libgee.rb │ │ ├── libgit2-glib.rb │ │ ├── libgit2.rb │ │ ├── libgsf.rb │ │ ├── libpeas.rb │ │ ├── librsvg.rb │ │ ├── libsecret.rb │ │ ├── pango.rb │ │ ├── shared-mime-info.rb │ │ └── vala.rb ├── bundle.json.in ├── data │ ├── Gitg-template.dmg.xz │ ├── Gitg.icns │ ├── Gitg.iconset │ │ ├── icon_128x128.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_16x16.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_32x32.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ ├── icon_512x512@2x.png │ │ ├── icon_64x64.png │ │ └── icon_64x64@2x.png │ └── Info.plist └── scripts │ ├── build │ ├── env │ ├── launcher │ ├── lbrew │ ├── make-bundle │ ├── make-dmg │ └── shell ├── plugins ├── diff │ ├── diff.plugin │ ├── gitg-diff.vala │ ├── icons │ │ └── diff-symbolic.svg │ ├── meson.build │ └── resources │ │ └── resources.xml ├── files │ ├── files.plugin │ ├── gitg-files-tree-store.vala │ ├── gitg-files.vala │ ├── meson.build │ └── resources │ │ ├── resources.xml │ │ └── view-files.ui └── meson.build ├── po ├── ChangeLog ├── LINGUAS ├── POTFILES.in ├── POTFILES.skip ├── ab.po ├── as.po ├── bg.po ├── bs.po ├── ca.po ├── ca@valencia.po ├── cs.po ├── da.po ├── de.po ├── el.po ├── en_GB.po ├── eo.po ├── es.po ├── eu.po ├── fi.po ├── fr.po ├── fur.po ├── gl.po ├── he.po ├── hi.po ├── hr.po ├── hu.po ├── id.po ├── ie.po ├── it.po ├── ja.po ├── ka.po ├── kk.po ├── ko.po ├── lt.po ├── lv.po ├── meson.build ├── ml.po ├── ms.po ├── nb.po ├── ne.po ├── nl.po ├── oc.po ├── pa.po ├── pl.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── sk.po ├── sl.po ├── sr.po ├── sr@latin.po ├── sv.po ├── tr.po ├── uk.po ├── update-potfiles ├── vi.po ├── zh_CN.po ├── zh_HK.po └── zh_TW.po ├── tests ├── diff-view.vala ├── gitg │ ├── application-mock.vala │ ├── checkout-remote-branch-dialog-mock.vala │ ├── main.vala │ ├── meson.build │ ├── notifications-mock.vala │ ├── ref-action-interface-mock.vala │ ├── simple-notification-mock.vala │ ├── test-checkout-ref.vala │ ├── test-cherry-pick-commit.vala │ └── test-merge-ref.vala ├── libgitg │ ├── main.vala │ ├── meson.build │ ├── test-commit.vala │ ├── test-date.vala │ ├── test-encoding.vala │ └── test-stage.vala ├── meson.build ├── progress-bin.vala ├── repository-list-box.vala └── support │ ├── gitg-assert.h │ ├── gitg-assert.vapi │ ├── main.vala │ ├── meson.build │ ├── repository.vala │ └── test.vala ├── vapi ├── GDesktopEnums-3.0.metadata ├── config.vapi ├── gitg-platform-support.vapi ├── gobject-introspection-1.0.vapi ├── gpg-error.vapi ├── gpgme.deps ├── gpgme.vapi ├── gsettings-desktop-schemas.vapi ├── gspell-1.deps ├── gspell-1.vapi ├── gtksourceview-4.deps ├── gtksourceview-4.vapi └── libpeas-1.0.vapi └── win32 ├── .gitignore ├── README ├── installer ├── COPYING.rtf ├── WixUIBannerBmp.bmp ├── WixUIDialogBmp.bmp ├── WixUIDialogBmp.svg ├── defines.wxi └── gitg.wxs ├── make-installer ├── make-installer-all └── make-installer.bat /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [*.vala] 10 | indent_size = 4 11 | indent_style = tab 12 | insert_final_newline = true 13 | max_line_length = 100 14 | 15 | [*.{c,h}] 16 | indent_size = 2 17 | indent_style = space 18 | insert_final_newline = true 19 | max_line_length = 100 20 | 21 | [*.css] 22 | indent_size = 2 23 | indent_style = space 24 | 25 | [*.{ui,xml,xml.in}] 26 | indent_size = 2 27 | indent_style = space 28 | 29 | [*.py] 30 | indent_size = 4 31 | indent_style = space 32 | 33 | [*.json] 34 | indent_style = space 35 | indent_size = 4 36 | 37 | [meson.build] 38 | indent_size = 2 39 | indent_style = space 40 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml' 2 | 3 | flatpak: 4 | extends: '.flatpak' 5 | variables: 6 | MANIFEST_PATH: "org.gnome.gitgDevel.json" 7 | RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo" 8 | FLATPAK_MODULE: "gitg" 9 | APP_ID: "org.gnome.gitgDevel" 10 | BUNDLE: "gitg-git.flatpak" 11 | 12 | 13 | nightly: 14 | extends: '.publish_nightly' 15 | dependencies: ['flatpak'] 16 | needs: ['flatpak'] 17 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Main/active authors: 2 | 3 | Jesse van den Kieboom 4 | Ignacio Casal Quinteiro 5 | Alberto Fanjul 6 | 7 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/ChangeLog -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Gitg 2 | 3 | Download on Flathub 4 | 5 | gitg is a graphical user interface for git. It aims at being a small, fast and convenient tool to visualize the history of git repositories. Besides visualization, gitg also provides several utilities to manage your repository and commit your work. 6 | 7 | The latest version of gitg is 44. 8 | 9 | - Website: https://wiki.gnome.org/Apps/Gitg 10 | - Issues: https://gitlab.gnome.org/GNOME/gitg/issues 11 | - Download: https://download.gnome.org/sources/gitg/ 12 | - Contact: https://discourse.gnome.org/tag/gitg 13 | - Translate: https://l10n.gnome.org/module/gitg/ 14 | 15 | ## Installing gitg 16 | 17 | To install the latest version of gitg, make sure to download gitg-44.tar.xz from the download site. After downloading the following procedure installs gitg: 18 | 19 | ``` 20 | $ tar Jxf gitg-44.tar.xz 21 | $ cd gitg-44 22 | $ meson --prefix=/usr build 23 | $ ninja -C build 24 | $ sudo ninja -C build install 25 | ``` 26 | 27 | ## Building gitg from git 28 | 29 | The gitg repository is hosted on gitlab.gnome.org. To build from git: 30 | 31 | ``` 32 | $ git clone https://gitlab.gnome.org/GNOME/gitg.git 33 | $ cd gitg 34 | $ meson --prefix=/usr build 35 | $ ninja -C build 36 | $ sudo ninja -C build install 37 | ``` 38 | 39 | Alternatively you can build using Flatpak with the org.gnome.gitgDevel.json manifest. 40 | 41 | ## Using gitg 42 | 43 | When gitg is installed, you can run gitg from the GNOME menu, or from a terminal by issueing: 'gitg'. Type 'gitg --help' to show the options you can specify on the command line. 44 | -------------------------------------------------------------------------------- /contrib/ide/ide-doap-person.h: -------------------------------------------------------------------------------- 1 | /* ide-doap-person.h 2 | * 3 | * Copyright (C) 2015 Christian Hergert 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef IDE_DOAP_PERSON_H 20 | #define IDE_DOAP_PERSON_H 21 | 22 | #include 23 | 24 | G_BEGIN_DECLS 25 | 26 | #define IDE_TYPE_DOAP_PERSON (ide_doap_person_get_type()) 27 | 28 | G_DECLARE_FINAL_TYPE (IdeDoapPerson, ide_doap_person, IDE, DOAP_PERSON, GObject) 29 | 30 | IdeDoapPerson *ide_doap_person_new (void); 31 | const gchar *ide_doap_person_get_name (IdeDoapPerson *self); 32 | void ide_doap_person_set_name (IdeDoapPerson *self, 33 | const gchar *name); 34 | const gchar *ide_doap_person_get_email (IdeDoapPerson *self); 35 | void ide_doap_person_set_email (IdeDoapPerson *self, 36 | const gchar *email); 37 | 38 | G_END_DECLS 39 | 40 | #endif /* IDE_DOAP_PERSON_H */ 41 | -------------------------------------------------------------------------------- /contrib/ide/ide.h: -------------------------------------------------------------------------------- 1 | /* ide.h 2 | * 3 | * Copyright (C) 2015 Christian Hergert 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef IDE_H 20 | #define IDE_H 21 | 22 | #include 23 | 24 | G_BEGIN_DECLS 25 | 26 | #include "ide-doap.h" 27 | #include "ide-doap-person.h" 28 | 29 | G_END_DECLS 30 | 31 | #endif /* IDE_H */ 32 | -------------------------------------------------------------------------------- /contrib/ide/ide.vapi: -------------------------------------------------------------------------------- 1 | // FIXME: in the future we might want to automatically generate this 2 | [CCode (cprefix = "Ide", gir_namespace = "Ide", gir_version = "1.0", lower_case_cprefix = "ide_")] 3 | namespace Ide { 4 | [CCode (cheader_filename = "ide.h", type_id = "ide_doap_get_type ()")] 5 | public class Doap : GLib.Object { 6 | [CCode (has_construct_function = false)] 7 | public Doap (); 8 | public unowned string get_bug_database (); 9 | public unowned string get_category (); 10 | public unowned string get_description (); 11 | public unowned string get_download_page (); 12 | public unowned string get_homepage (); 13 | [CCode (array_length = false, array_null_terminated = true)] 14 | public unowned string[] get_languages (); 15 | public unowned GLib.List get_maintainers (); 16 | public unowned string get_name (); 17 | public unowned string get_shortdesc (); 18 | public bool load_from_file (GLib.File file, GLib.Cancellable? cancellable = null) throws GLib.Error; 19 | public bool load_from_data (string data, size_t length) throws GLib.Error; 20 | [NoAccessorMethod] 21 | public string bug_database { owned get; set; } 22 | [NoAccessorMethod] 23 | public string category { owned get; set; } 24 | [NoAccessorMethod] 25 | public string description { owned get; set; } 26 | [NoAccessorMethod] 27 | public string download_page { owned get; set; } 28 | [NoAccessorMethod] 29 | public string homepage { owned get; set; } 30 | [NoAccessorMethod] 31 | public string languages { owned get; set; } 32 | [NoAccessorMethod] 33 | public string name { owned get; set; } 34 | [NoAccessorMethod] 35 | public string shortdesc { owned get; set; } 36 | } 37 | [CCode (cheader_filename = "ide.h", type_id = "ide_doap_person_get_type ()")] 38 | public class DoapPerson : GLib.Object { 39 | [CCode (has_construct_function = false)] 40 | public DoapPerson (); 41 | public unowned string get_email (); 42 | public unowned string get_name (); 43 | public void set_email (string email); 44 | public void set_name (string name); 45 | public string email { get; set; } 46 | public string name { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /contrib/ide/meson.build: -------------------------------------------------------------------------------- 1 | common_deps = [ 2 | gio_dep, 3 | glib_dep, 4 | ] 5 | 6 | sources = files( 7 | 'ide-doap.c', 8 | 'ide-doap-person.c', 9 | ) 10 | 11 | deps = common_deps + [libxml_reader_dep] 12 | 13 | libide = static_library( 14 | 'ide', 15 | sources: sources, 16 | include_directories: top_inc, 17 | dependencies: deps, 18 | ) 19 | 20 | libide_dep = declare_dependency( 21 | include_directories: include_directories('.'), 22 | dependencies: common_deps + [valac.find_library('ide', dirs: meson.current_source_dir())], 23 | link_with: libide, 24 | ) 25 | -------------------------------------------------------------------------------- /contrib/xml/meson.build: -------------------------------------------------------------------------------- 1 | sources = files('xml-reader.c') 2 | 3 | deps = [ 4 | gio_dep, 5 | libxml_dep, 6 | ] 7 | 8 | libxml_reader = static_library( 9 | 'xml', 10 | sources: sources, 11 | include_directories: top_inc, 12 | dependencies: deps, 13 | ) 14 | 15 | libxml_reader_dep = declare_dependency( 16 | include_directories: include_directories('.'), 17 | dependencies: deps, 18 | link_with: libxml_reader, 19 | ) 20 | -------------------------------------------------------------------------------- /data/gitg-glade.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /data/gitg.1: -------------------------------------------------------------------------------- 1 | .TH GITG "1" "December 2018" "gitg" "User Commands" 2 | .SH NAME 3 | gitg \- Git repository viewer 4 | .SH SYNOPSIS 5 | .B gitg 6 | [\fI\,OPTION\/\fR]... [\fI\,REPOSITORY\/\fR]... 7 | .SH DESCRIPTION 8 | .B gitg 9 | is a graphical user interface for git. It aims at being a small, 10 | fast and convenient tool to visualize the history of git repositories. 11 | Besides visualization, gitg also provides several utilities to manage your 12 | repository and commit your work. 13 | .SH OPTIONS 14 | Help Options: 15 | .TP 16 | \fB\-h\fR, \fB\-\-help\fR 17 | Show help options 18 | .TP 19 | \fB\-\-help\-all\fR 20 | Show all help options 21 | .TP 22 | \fB\-\-help\-gtk\fR 23 | Show GTK+ Options 24 | .PP 25 | Application Options: 26 | .TP 27 | \fB\-v\fR, \fB\-\-version\fR 28 | Show the application?s version 29 | .TP 30 | \fB\-\-activity\fR 31 | Start gitg with a particular activity 32 | .TP 33 | \fB\-c\fR, \fB\-\-commit\fR 34 | Start gitg with the commit activity (shorthand for \fB\-\-activity\fR commit) 35 | .TP 36 | \fB\-\-no\-wd\fR 37 | Do not try to load a repository from the current working directory 38 | .TP 39 | \fB\-\-standalone\fR 40 | Run gitg in standalone mode 41 | .TP 42 | \fB\-\-display\fR=\fI\,DISPLAY\/\fR 43 | X display to use 44 | .TP 45 | \fB\-a\fR, \fB\-\-all\fR 46 | Select all commits by default in the history activity 47 | .TP 48 | \fB\-b\fR, \fB\-\-branches\fR 49 | Select all branches by default in the history activity 50 | .TP 51 | \fB\-r\fR, \fB\-\-remotes\fR 52 | Select all remotes by default in the history activity 53 | .TP 54 | \fB\-t\fR, \fB\-\-tags\fR 55 | Select all tags by default in the history activity 56 | .TP 57 | \fB\-s\fR, \fB\-\-select\-reference\fR=\fI\,REFERENCE\/\fR 58 | Select the specified reference by default in the history activity 59 | .PP 60 | .B gitg 61 | will try to load any REPOSITORY passed as command line argument (multiple paths can be passed). 62 | .PP 63 | If no repository is specified, 64 | .B gitg 65 | will try to open the repository specified by the \fBGIT_DIR\fR environment variable; 66 | if \fBGIT_DIR\fR is not set 67 | .B gitg 68 | will try to open the repository at the current working directory. 69 | .SH ENVIRONMENT VARIABLES 70 | \fBGIT_DIR\fR 71 | .RS 4 72 | If the 73 | \fBGIT_DIR\fR 74 | environment variable is set, and no repositories have been passed as command line arguments, then it specifies a path to use instead of the default 75 | \fB\&.git\fR 76 | for the base of the repository\&. 77 | .RE 78 | .SH AUTHORS 79 | Jesse van den Kieboom 80 | .br 81 | Alberto Fanjul 82 | -------------------------------------------------------------------------------- /data/icons/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | '@0@.svg'.format(application_id), 3 | install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', 'scalable', 'apps'), 4 | ) 5 | 6 | install_data( 7 | 'org.gnome.gitg-symbolic.svg', 8 | install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', 'scalable', 'apps'), 9 | ) 10 | -------------------------------------------------------------------------------- /data/icons/org.gnome.gitg-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 17 | 18 | 20 | image/svg+xml 21 | 23 | 24 | 25 | 26 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /data/org.gnome.gitg.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Gitg 3 | Comment=Git repository browser 4 | Exec=@binary@ --no-wd %U 5 | TryExec=@binary@ 6 | Terminal=false 7 | Type=Application 8 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 9 | Icon=@icon@ 10 | Categories=GNOME;GTK;Development;RevisionControl; 11 | MimeType=x-scheme-handler/gitg; 12 | #X-GNOME-DocPath=gitg/gitg.xml 13 | Actions=new-window; 14 | 15 | [Desktop Action new-window] 16 | Name=New Window 17 | Exec=@binary@ --no-wd %U 18 | -------------------------------------------------------------------------------- /data/screenshots/commit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/data/screenshots/commit.png -------------------------------------------------------------------------------- /data/screenshots/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/data/screenshots/history.png -------------------------------------------------------------------------------- /data/screenshots/projects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/data/screenshots/projects.png -------------------------------------------------------------------------------- /data/screenshots/stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/data/screenshots/stage.png -------------------------------------------------------------------------------- /gitg.doap: -------------------------------------------------------------------------------- 1 | 2 | 7 | Gitg 8 | git repository viewer for GTK+/GNOME 9 | gitg is a graphical user interface for git. It aims at being a small, 10 | fast and convenient tool to visualize the history of git repositories. 11 | Besides visualization, gitg also provides several utilities to manage your 12 | repository and commit your work. 13 | 14 | 15 | 16 | 17 | 18 | Vala 19 | 20 | 21 | 22 | Alberto Fanjul Alonso 23 | 24 | albfan 25 | 26 | 27 | 28 | 37 | 38 | 39 | 40 | Ignacio Casal Quinteiro 41 | 42 | icq 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /gitg/commit/TODO.md: -------------------------------------------------------------------------------- 1 | # To implement 2 | * Rendering of permission changes 3 | * Selecting multiple files 4 | * DND 5 | 6 | * External diff 7 | This is currently not possible with libgit2. 8 | 9 | * Graceful handling of merge conflicts in the index. 10 | Bug 603585 - When a merge conflic is commited, gitg taints the status 11 | 12 | # To check 13 | * Handling of binary files/diffs 14 | * Support for symbolic links 15 | -------------------------------------------------------------------------------- /gitg/commit/gitg-commit-submodule-diff-view.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgCommit 21 | { 22 | 23 | [GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-commit-submodule-diff-view.ui")] 24 | class SubmoduleDiffView : Gtk.Box 25 | { 26 | [GtkChild (name = "info")] 27 | private unowned SubmoduleInfo d_info; 28 | 29 | [GtkChild (name = "diff_view_staged")] 30 | private unowned Gitg.DiffView d_diff_view_staged; 31 | 32 | [GtkChild (name = "diff_view_unstaged")] 33 | private unowned Gitg.DiffView d_diff_view_unstaged; 34 | 35 | [GtkChild (name = "box_diffs")] 36 | private unowned Gtk.Box d_box_diffs; 37 | 38 | construct 39 | { 40 | var interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface"); 41 | 42 | interface_settings.bind("orientation", 43 | d_box_diffs, 44 | "orientation", 45 | SettingsBindFlags.GET); 46 | } 47 | 48 | public SubmoduleInfo info 49 | { 50 | get { return d_info; } 51 | } 52 | 53 | public Gitg.DiffView diff_view_staged 54 | { 55 | get { return d_diff_view_staged; } 56 | } 57 | 58 | public Gitg.DiffView diff_view_unstaged 59 | { 60 | get { return d_diff_view_unstaged; } 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /gitg/commit/gitg-commit-submodule-history-view.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgCommit 21 | { 22 | 23 | [GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-commit-submodule-history-view.ui")] 24 | class SubmoduleHistoryView : Gtk.Paned 25 | { 26 | [GtkChild (name = "commit_list_view")] 27 | private unowned Gitg.CommitListView d_commit_list_view; 28 | 29 | [GtkChild (name = "diff_view")] 30 | private unowned Gitg.DiffView d_diff_view; 31 | 32 | public Gitg.CommitListView commit_list_view 33 | { 34 | get { return d_commit_list_view; } 35 | } 36 | 37 | public Gitg.DiffView diff_view 38 | { 39 | get { return d_diff_view; } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /gitg/gitg-add-remote-action-dialog.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2022 - Adwait Rawat 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | [GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-add-remote-action-dialog.ui")] 24 | class AddRemoteActionDialog : Gtk.Dialog 25 | { 26 | [GtkChild] 27 | private unowned Gtk.Button d_button_create; 28 | 29 | [GtkChild] 30 | private unowned Gtk.Entry d_entry_remote_name; 31 | 32 | [GtkChild] 33 | private unowned Gtk.Entry d_entry_remote_url; 34 | 35 | construct 36 | { 37 | d_entry_remote_name.changed.connect(input_changed); 38 | d_entry_remote_url.changed.connect(input_changed); 39 | 40 | set_default(d_button_create); 41 | set_default_response(Gtk.ResponseType.OK); 42 | } 43 | 44 | private void input_changed () { 45 | bool is_name_valid = d_entry_remote_name.text != ""; 46 | bool is_url_valid = d_entry_remote_url.text != ""; 47 | 48 | set_response_sensitive(Gtk.ResponseType.OK, is_name_valid && is_url_valid); 49 | } 50 | 51 | public AddRemoteActionDialog(Gtk.Window? parent) 52 | { 53 | Object(use_header_bar : 1); 54 | 55 | if (parent != null) 56 | { 57 | set_transient_for(parent); 58 | } 59 | } 60 | 61 | public string remote_name 62 | { 63 | owned get 64 | { 65 | return d_entry_remote_name.text.strip(); 66 | } 67 | 68 | set 69 | { 70 | d_entry_remote_name.text = value.strip(); 71 | } 72 | } 73 | 74 | public string remote_url 75 | { 76 | owned get 77 | { 78 | return d_entry_remote_url.text.strip(); 79 | } 80 | 81 | set 82 | { 83 | d_entry_remote_url.text = value.strip(); 84 | } 85 | } 86 | } 87 | 88 | } 89 | 90 | // ex: ts=4 noet 91 | -------------------------------------------------------------------------------- /gitg/gitg-builder.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2015 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | class Gitg.Builder 21 | { 22 | public static T? load_object(string id, string object) 23 | { 24 | var ret = GitgExt.UI.from_builder(id, object); 25 | 26 | if (ret == null) 27 | { 28 | return null; 29 | } 30 | 31 | return (T?)ret[object]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /gitg/gitg-create-branch-dialog.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | [GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-create-branch-dialog.ui")] 24 | class CreateBranchDialog : Gtk.Dialog 25 | { 26 | [GtkChild] 27 | private unowned Gtk.Button d_button_create; 28 | 29 | [GtkChild] 30 | private unowned Gtk.Entry d_entry_branch_name; 31 | 32 | [GtkChild] 33 | private unowned Gtk.CheckButton d_checkout_created; 34 | 35 | private Settings d_settings; 36 | 37 | construct 38 | { 39 | d_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.branch"); 40 | 41 | d_settings.bind("checkout-created-branch", 42 | d_checkout_created, 43 | "active", 44 | SettingsBindFlags.GET | SettingsBindFlags.SET); 45 | 46 | d_entry_branch_name.changed.connect(input_changed); 47 | 48 | set_default(d_button_create); 49 | set_default_response(Gtk.ResponseType.OK); 50 | } 51 | 52 | private void input_changed () { 53 | set_response_sensitive(Gtk.ResponseType.OK, new_branch_name != ""); 54 | } 55 | 56 | public CreateBranchDialog(Gtk.Window? parent) 57 | { 58 | Object(use_header_bar : 1); 59 | 60 | if (parent != null) 61 | { 62 | set_transient_for(parent); 63 | } 64 | } 65 | 66 | public string new_branch_name 67 | { 68 | owned get 69 | { 70 | return d_entry_branch_name.text.strip(); 71 | } 72 | } 73 | 74 | public bool checkout_created 75 | { 76 | get 77 | { 78 | return d_checkout_created.active; 79 | } 80 | } 81 | } 82 | 83 | } 84 | 85 | // ex: ts=4 noet 86 | -------------------------------------------------------------------------------- /gitg/gitg-dirs.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | public class Dirs 24 | { 25 | public static string data_dir 26 | { 27 | owned get { return PlatformSupport.get_data_dir(); } 28 | } 29 | 30 | public static string locale_dir 31 | { 32 | owned get { return PlatformSupport.get_locale_dir(); } 33 | } 34 | 35 | public static string lib_dir 36 | { 37 | owned get { return PlatformSupport.get_lib_dir(); } 38 | } 39 | 40 | public static string plugins_dir 41 | { 42 | owned get { return Path.build_filename(lib_dir, "plugins"); } 43 | } 44 | 45 | public static string plugins_data_dir 46 | { 47 | owned get { return Path.build_filename(data_dir, "plugins"); } 48 | } 49 | 50 | public static string user_plugins_dir 51 | { 52 | owned get { return Path.build_filename(user_data_dir, "plugins"); } 53 | } 54 | 55 | public static string user_plugins_data_dir 56 | { 57 | owned get { return user_plugins_dir; } 58 | } 59 | 60 | public static string user_data_dir 61 | { 62 | owned get { return Path.build_filename(Environment.get_user_data_dir(), "gitg"); } 63 | } 64 | 65 | public static string build_data_file(string part, ...) 66 | { 67 | var l = va_list(); 68 | var ret = Path.build_filename(data_dir, part, null); 69 | 70 | while (true) 71 | { 72 | string? s = l.arg(); 73 | 74 | if (s == null) 75 | { 76 | break; 77 | } 78 | 79 | ret = Path.build_filename(ret, s); 80 | } 81 | 82 | return ret; 83 | } 84 | } 85 | 86 | } 87 | 88 | // ex: ts=4 noet 89 | -------------------------------------------------------------------------------- /gitg/gitg-edit-remote-dialog.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2022 - Adwait Rawat 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | [GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-edit-remote-dialog.ui")] 24 | class EditRemoteDialog : Gtk.Dialog 25 | { 26 | [GtkChild] 27 | private unowned Gtk.Button d_button_save; 28 | 29 | [GtkChild] 30 | private unowned Gtk.Entry d_entry_remote_name; 31 | 32 | [GtkChild] 33 | private unowned Gtk.Entry d_entry_remote_url; 34 | 35 | construct 36 | { 37 | d_entry_remote_name.changed.connect(() => { 38 | var is_name_valid = (d_entry_remote_name.text != ""); 39 | 40 | d_entry_remote_url.changed.connect((e) => { 41 | var is_url_valid = (d_entry_remote_url.text != ""); 42 | 43 | set_response_sensitive(Gtk.ResponseType.OK, is_name_valid && is_url_valid); 44 | }); 45 | }); 46 | 47 | set_default(d_button_save); 48 | set_default_response(Gtk.ResponseType.OK); 49 | } 50 | 51 | public EditRemoteDialog(Gtk.Window? parent) 52 | { 53 | Object(use_header_bar : 1); 54 | 55 | if (parent != null) 56 | { 57 | set_transient_for(parent); 58 | } 59 | } 60 | 61 | public string new_remote_name 62 | { 63 | owned get 64 | { 65 | return d_entry_remote_name.text.strip(); 66 | } 67 | set 68 | { 69 | d_entry_remote_name.text = value; 70 | } 71 | } 72 | 73 | public string new_remote_url 74 | { 75 | owned get 76 | { 77 | return d_entry_remote_url.text.strip(); 78 | } 79 | set 80 | { 81 | d_entry_remote_url.text = value; 82 | } 83 | } 84 | } 85 | 86 | } 87 | 88 | // ex: ts=4 noet 89 | -------------------------------------------------------------------------------- /gitg/gitg-plugins-engine.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | public class PluginsEngine : Peas.Engine 24 | { 25 | private static PluginsEngine s_instance; 26 | 27 | construct 28 | { 29 | enable_loader("python"); 30 | 31 | var repo = Introspection.Repository.get_default(); 32 | 33 | try 34 | { 35 | repo.require("Peas", "1.0", 0); 36 | repo.require("PeasGtk", "1.0", 0); 37 | } 38 | catch (Error e) 39 | { 40 | warning("Could not load repository: %s", e.message); 41 | return; 42 | } 43 | 44 | add_search_path(Dirs.user_plugins_dir, 45 | Dirs.user_plugins_data_dir); 46 | 47 | add_search_path(Dirs.plugins_dir, 48 | Dirs.plugins_data_dir); 49 | 50 | Peas.PluginInfo[] builtins = new Peas.PluginInfo[20]; 51 | builtins.length = 0; 52 | 53 | foreach (var info in get_plugin_list()) 54 | { 55 | if (info.is_builtin()) 56 | { 57 | builtins += info; 58 | } 59 | } 60 | 61 | foreach (var info in builtins) 62 | { 63 | load_plugin(info); 64 | } 65 | } 66 | 67 | public new static PluginsEngine get_default() 68 | { 69 | if (s_instance == null) 70 | { 71 | s_instance = new PluginsEngine(); 72 | s_instance.add_weak_pointer(&s_instance); 73 | } 74 | 75 | return s_instance; 76 | } 77 | 78 | public static void initialize() 79 | { 80 | get_default(); 81 | } 82 | } 83 | 84 | } 85 | 86 | // ex: ts=4 noet 87 | -------------------------------------------------------------------------------- /gitg/gitg-ref-action-copy-name.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class RefActionCopyName : GitgExt.UIElement, GitgExt.Action, GitgExt.RefAction, Object 24 | { 25 | // Do this to pull in config.h before glib.h (for gettext...) 26 | private const string version = Gitg.Config.VERSION; 27 | 28 | public GitgExt.Application? application { owned get; construct set; } 29 | public GitgExt.RefActionInterface action_interface { get; construct set; } 30 | public Gitg.Ref reference { get; construct set; } 31 | 32 | public RefActionCopyName(GitgExt.Application application, 33 | GitgExt.RefActionInterface action_interface, 34 | Gitg.Ref reference) 35 | { 36 | Object(application: application, 37 | action_interface: action_interface, 38 | reference: reference); 39 | } 40 | 41 | public string id 42 | { 43 | owned get { return "/org/gnome/gitg/ref-actions/copy-name"; } 44 | } 45 | 46 | public string display_name 47 | { 48 | owned get { return _("Copy name"); } 49 | } 50 | 51 | public string description 52 | { 53 | owned get { return _("Copy the name of the reference to the clipboard"); } 54 | } 55 | 56 | public bool enabled 57 | { 58 | get { return true; } 59 | } 60 | 61 | public void activate() 62 | { 63 | var clip = ((Gtk.Widget)application).get_clipboard(Gdk.SELECTION_CLIPBOARD); 64 | clip.set_text(reference.parsed_name.shortname, -1); 65 | 66 | clip = ((Gtk.Widget)application).get_clipboard(Gdk.SELECTION_PRIMARY); 67 | clip.set_text(reference.parsed_name.shortname, -1); 68 | } 69 | } 70 | 71 | } 72 | 73 | // ex:set ts=4 noet 74 | -------------------------------------------------------------------------------- /gitg/gitg-ref-action-create-branch.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2022 - Adwait Rawat 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class RefActionCreateBranch : CommitActionCreateBranch, GitgExt.RefAction 24 | { 25 | // Do this to pull in config.h before glib.h (for gettext...) 26 | private const string version = Gitg.Config.VERSION; 27 | 28 | public Gitg.Ref reference { get; construct set; } 29 | 30 | public RefActionCreateBranch(GitgExt.Application application, 31 | GitgExt.RefActionInterface action_interface, 32 | Gitg.Ref reference) 33 | { 34 | Object(application: application, 35 | action_interface: action_interface, 36 | reference: reference); 37 | } 38 | 39 | public override string id 40 | { 41 | owned get { return "/org/gnome/gitg/ref-actions/create-branch"; } 42 | } 43 | 44 | public override string description 45 | { 46 | owned get { return _("Create a new branch at the selected reference"); } 47 | } 48 | 49 | public override void activate() 50 | { 51 | try 52 | { 53 | commit = reference.resolve().lookup() as Gitg.Commit; 54 | base.activate(); 55 | } 56 | catch (Error e) 57 | { 58 | application.show_infobar (_("Failed to lookup reference"), 59 | e.message, 60 | Gtk.MessageType.ERROR); 61 | return; 62 | } 63 | } 64 | } 65 | 66 | } 67 | 68 | // ex:set ts=4 noet 69 | -------------------------------------------------------------------------------- /gitg/gitg-ref-action-create-patch.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2022 - Adwait Rawat 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class RefActionCreatePatch : CommitActionCreatePatch, GitgExt.RefAction 24 | { 25 | // Do this to pull in config.h before glib.h (for gettext...) 26 | private const string version = Gitg.Config.VERSION; 27 | 28 | public Gitg.Ref reference { get; construct set; } 29 | 30 | public RefActionCreatePatch(GitgExt.Application application, 31 | GitgExt.RefActionInterface action_interface, 32 | Gitg.Ref reference) 33 | { 34 | Object(application: application, 35 | action_interface: action_interface, 36 | reference: reference); 37 | } 38 | 39 | public override string id 40 | { 41 | owned get { return "/org/gnome/gitg/ref-actions/create-patch"; } 42 | } 43 | 44 | public override string description 45 | { 46 | owned get { return _("Create a patch from the selected reference"); } 47 | } 48 | 49 | public override void activate() 50 | { 51 | try 52 | { 53 | commit = reference.resolve().lookup() as Gitg.Commit; 54 | base.activate(); 55 | } 56 | catch (Error e) 57 | { 58 | application.show_infobar (_("Failed to lookup reference"), 59 | e.message, 60 | Gtk.MessageType.ERROR); 61 | return; 62 | } 63 | } 64 | } 65 | 66 | } 67 | 68 | // ex:set ts=4 noet 69 | -------------------------------------------------------------------------------- /gitg/gitg-ref-action-create-tag.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2022 - Adwait Rawat 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class RefActionCreateTag : CommitActionCreateTag, GitgExt.RefAction 24 | { 25 | // Do this to pull in config.h before glib.h (for gettext...) 26 | private const string version = Gitg.Config.VERSION; 27 | 28 | public Gitg.Ref reference { get; construct set; } 29 | 30 | public RefActionCreateTag(GitgExt.Application application, 31 | GitgExt.RefActionInterface action_interface, 32 | Gitg.Ref reference) 33 | { 34 | Object(application: application, 35 | action_interface: action_interface, 36 | reference: reference); 37 | } 38 | 39 | public override string id 40 | { 41 | owned get { return "/org/gnome/gitg/ref-actions/create-tag"; } 42 | } 43 | 44 | public override string description 45 | { 46 | owned get { return _("Create a new tag at the selected reference"); } 47 | } 48 | 49 | public override void activate() 50 | { 51 | try 52 | { 53 | commit = reference.resolve().lookup() as Gitg.Commit; 54 | base.activate(); 55 | } 56 | catch (Error e) 57 | { 58 | application.show_infobar (_("Failed to lookup reference"), 59 | e.message, 60 | Gtk.MessageType.ERROR); 61 | return; 62 | } 63 | } 64 | } 65 | 66 | } 67 | 68 | // ex:set ts=4 noet 69 | -------------------------------------------------------------------------------- /gitg/gitg-ref-action-tag-info.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2023 - Alberto Fanjul 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class RefActionTagShowInfo : GitgExt.UIElement, GitgExt.Action, GitgExt.RefAction, Object 24 | { 25 | private const string version = Gitg.Config.VERSION; 26 | 27 | public GitgExt.Application? application { owned get; construct set; } 28 | public GitgExt.RefActionInterface action_interface { get; construct set; } 29 | public Gitg.Ref reference { get; construct set; } 30 | 31 | public bool available 32 | { 33 | get 34 | { 35 | return reference.is_tag(); 36 | } 37 | } 38 | 39 | public override string id 40 | { 41 | owned get { return "/org/gnome/gitg/ref-actions/tag-show-info"; } 42 | } 43 | 44 | public string display_name 45 | { 46 | owned get { return _("Show tag info"); } 47 | } 48 | 49 | public virtual string description 50 | { 51 | owned get { return _("Show info at selected tag"); } 52 | } 53 | 54 | public virtual void activate() 55 | { 56 | var dlg = new TagShowInfoDialog((Gtk.Window)application, reference); 57 | 58 | dlg.response.connect((d, resp) => { 59 | 60 | dlg.destroy(); 61 | finished(); 62 | }); 63 | dlg.show(); 64 | } 65 | 66 | public RefActionTagShowInfo(GitgExt.Application application, 67 | GitgExt.RefActionInterface action_interface, 68 | Gitg.Ref reference) 69 | { 70 | Object(application: application, 71 | action_interface: action_interface, 72 | reference: reference); 73 | } 74 | } 75 | 76 | } 77 | 78 | // ex:set ts=4 noet 79 | -------------------------------------------------------------------------------- /gitg/gitg-remote-fetch-all-action.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2022 - Adwait Rawat 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class FetchAllRemotesAction : GitgExt.UIElement, GitgExt.Action, Object 24 | { 25 | // Do this to pull in config.h before glib.h (for gettext...) 26 | private const string version = Gitg.Config.VERSION; 27 | 28 | public GitgExt.Application? application { owned get; construct set; } 29 | public GitgHistory.RefsList refs_list; 30 | 31 | public FetchAllRemotesAction(GitgExt.Application application, GitgHistory.RefsList refs_list) 32 | { 33 | Object(application: application); 34 | this.refs_list = refs_list; 35 | } 36 | 37 | public string id 38 | { 39 | owned get { return "/org/gnome/gitg/ref-actions/fetch-all-remotes"; } 40 | } 41 | 42 | public string display_name 43 | { 44 | owned get { return _("Fetch all remotes"); } 45 | } 46 | 47 | public string description 48 | { 49 | owned get { return _("Fetch objects from all remotes"); } 50 | } 51 | 52 | public void activate() 53 | { 54 | refs_list.references.foreach((r) => { 55 | var remote_name = r.parsed_name.remote_name; 56 | var remote = application.remote_lookup.lookup(remote_name); 57 | remote.fetch.begin(null, null, (obj, res) => { 58 | remote.fetch.end(res); 59 | }); 60 | return true; 61 | }); 62 | } 63 | } 64 | 65 | } 66 | 67 | // ex:set ts=4 noet 68 | -------------------------------------------------------------------------------- /gitg/gitg-tag-show-info-dialog.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2023 - Alberto Fanjul 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | [GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-tag-show-info-dialog.ui")] 24 | class TagShowInfoDialog : Gtk.Dialog 25 | { 26 | private const string version = Gitg.Config.VERSION; 27 | 28 | [GtkChild] 29 | private unowned Gtk.Label d_name; 30 | 31 | [GtkChild] 32 | private unowned Gtk.Label d_message; 33 | 34 | construct 35 | { 36 | set_default_response(Gtk.ResponseType.OK); 37 | } 38 | 39 | public TagShowInfoDialog(Gtk.Window? parent, Gitg.Ref reference) 40 | { 41 | Object(use_header_bar : 1); 42 | 43 | if (parent != null) 44 | { 45 | set_transient_for(parent); 46 | } 47 | var tag = (Ggit.Tag)reference.resolve().lookup(); 48 | 49 | var name = tag.get_name(); 50 | d_name.set_markup(@"$name"); 51 | d_message.set_text(tag.get_message()); 52 | } 53 | } 54 | 55 | } 56 | 57 | // ex: ts=4 noet 58 | -------------------------------------------------------------------------------- /gitg/gitg.rc: -------------------------------------------------------------------------------- 1 | A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "resources/pixmaps/gitg.ico" 2 | -------------------------------------------------------------------------------- /gitg/gitg.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | private const string version = Config.VERSION; 24 | 25 | public class Main 26 | { 27 | public static int main(string[] args) 28 | { 29 | Gtk.disable_setlocale(); 30 | 31 | Intl.setlocale(LocaleCategory.ALL, ""); 32 | Intl.setlocale(LocaleCategory.COLLATE, "C"); 33 | 34 | Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Dirs.locale_dir); 35 | Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); 36 | Intl.textdomain(Config.GETTEXT_PACKAGE); 37 | 38 | Environment.set_prgname(Gitg.Config.APPLICATION_ID); 39 | Environment.set_application_name(_("gitg")); 40 | Gtk.Window.set_default_icon_name(Gitg.Config.APPLICATION_ID); 41 | 42 | Application app = new Application(); 43 | return app.run(args); 44 | } 45 | } 46 | 47 | } 48 | 49 | // ex:set ts=4 noet 50 | -------------------------------------------------------------------------------- /gitg/history/gitg-history-action-interface.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgHistory 21 | { 22 | 23 | class ActionInterface : Object, GitgExt.RefActionInterface 24 | { 25 | public GitgExt.Application application { owned get; construct set; } 26 | 27 | private RefsList d_refs_list; 28 | 29 | public signal void updated(); 30 | 31 | public ActionInterface(GitgExt.Application application, RefsList refs_list) 32 | { 33 | Object(application: application); 34 | 35 | d_refs_list = refs_list; 36 | } 37 | 38 | public Gee.List references 39 | { 40 | owned get { return d_refs_list.references; } 41 | } 42 | 43 | public void add_ref(Gitg.Ref reference) 44 | { 45 | application.repository.clear_refs_cache(); 46 | d_refs_list.add_ref(reference); 47 | updated(); 48 | } 49 | 50 | public void remove_ref(Gitg.Ref reference) 51 | { 52 | application.repository.clear_refs_cache(); 53 | d_refs_list.remove_ref(reference); 54 | updated(); 55 | } 56 | 57 | public void replace_ref(Gitg.Ref old_ref, Gitg.Ref new_ref) 58 | { 59 | application.repository.clear_refs_cache(); 60 | d_refs_list.replace_ref(old_ref, new_ref); 61 | updated(); 62 | } 63 | 64 | public void set_busy(Gitg.Ref reference, bool busy) 65 | { 66 | // TODO 67 | } 68 | 69 | public void edit_ref_name(Gitg.Ref reference, owned GitgExt.RefNameEditingDone done) 70 | { 71 | d_refs_list.edit(reference, (owned)done); 72 | } 73 | 74 | public void refresh() 75 | { 76 | d_refs_list.repository = application.repository; 77 | updated(); 78 | } 79 | } 80 | 81 | } 82 | 83 | // ex: ts=4 noet 84 | -------------------------------------------------------------------------------- /gitg/preferences/gitg-preferences-dialog.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class PreferencesDialog : Gtk.Dialog, Gtk.Buildable 24 | { 25 | private Gtk.Notebook d_notebook; 26 | 27 | private void parser_finished(Gtk.Builder builder) 28 | { 29 | // Extract widgets from the builder 30 | d_notebook = builder.get_object("notebook_elements") as Gtk.Notebook; 31 | 32 | // Populate tabs from plugins 33 | populate(); 34 | 35 | base.parser_finished(builder); 36 | } 37 | 38 | private void add_page(GitgExt.Preferences pref, HashTable pages) 39 | { 40 | Gtk.Box page; 41 | 42 | if (!pages.lookup_extended(pref.id, null, out page)) 43 | { 44 | page = new Gtk.Box(Gtk.Orientation.VERTICAL, 6); 45 | 46 | page.show(); 47 | pages.insert(pref.id, page); 48 | 49 | var lbl = new Gtk.Label(pref.display_name); 50 | lbl.show(); 51 | 52 | d_notebook.append_page(page, lbl); 53 | } 54 | 55 | page.add(pref.widget); 56 | 57 | d_notebook.child_set_property (page, "tab-expand", true); 58 | } 59 | 60 | public void populate() 61 | { 62 | var engine = PluginsEngine.get_default(); 63 | var ext = new Peas.ExtensionSet(engine, typeof(GitgExt.Preferences)); 64 | 65 | var pages = new HashTable(str_hash, str_equal); 66 | 67 | add_page(new PreferencesInterface(), pages); 68 | add_page(new PreferencesHistory(), pages); 69 | add_page(new PreferencesCommit(), pages); 70 | 71 | ext.foreach((s, info, e) => { 72 | add_page(e as GitgExt.Preferences, pages); 73 | }); 74 | } 75 | } 76 | 77 | } 78 | 79 | // vi:ts=4 80 | -------------------------------------------------------------------------------- /gitg/resources/pixmaps/gitg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/gitg/resources/pixmaps/gitg.ico -------------------------------------------------------------------------------- /gitg/resources/ui/gitg-history-ref-header.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /gitg/resources/ui/gitg-history-ref-row.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /gitg/resources/ui/gitg-menus.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | _Reload 8 | win.reload 9 | 10 |
11 |
12 | 13 | _Preferences 14 | win.preferences 15 | 16 |
17 |
18 | 19 | _Author Details 20 | win.author-details-repo 21 | 22 |
23 |
24 | 25 | _Keyboard Shortcuts 26 | app.shortcuts 27 | 28 | 29 | _About gitg 30 | app.about 31 | 32 |
33 |
34 | 35 |
36 | 37 | _New Window 38 | app.new 39 | 40 |
41 |
42 | 43 | _Author Details 44 | app.author-details-global 45 | 46 |
47 |
48 | 49 | _Preferences 50 | app.preferences 51 | 52 |
53 |
54 | 55 | _Keyboard Shortcuts 56 | app.shortcuts 57 | 58 | 59 | _About gitg 60 | app.about 61 | 62 |
63 |
64 |
65 | 66 | -------------------------------------------------------------------------------- /gitg/resources/ui/gitg-preferences.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | False 6 | 5 7 | False 8 | dialog 9 | 0 10 | 1 11 | Preferences 12 | 13 | 14 | False 15 | vertical 16 | 0 17 | 18 | 19 | True 20 | True 21 | True 22 | True 23 | False 24 | 25 | 26 | False 27 | True 28 | 1 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /gitg/resources/ui/gitg-remote-notification.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /gitg/resources/ui/style-osx.css: -------------------------------------------------------------------------------- 1 | /* osx css styles */ 2 | 3 | .monospace { 4 | font-family: menlo; 5 | } 6 | -------------------------------------------------------------------------------- /gitg/resources/ui/style-unix.css: -------------------------------------------------------------------------------- 1 | /* unix styles */ 2 | -------------------------------------------------------------------------------- /gitg/resources/ui/style-win32.css: -------------------------------------------------------------------------------- 1 | /* win32 css styles */ 2 | -------------------------------------------------------------------------------- /libgitg-ext/GitgExt.py: -------------------------------------------------------------------------------- 1 | from gi.repository import GObject 2 | from ..overrides import override 3 | from ..importer import modules 4 | 5 | GitgExt = modules['GitgExt']._introspection_module 6 | __all__ = [] 7 | 8 | class MessageBus(GitgExt.MessageBus): 9 | def create(self, msgid, **kwargs): 10 | tp = self.lookup(msgid) 11 | 12 | if not tp.is_a(GitgExt.Message.__gtype__): 13 | return None 14 | 15 | kwargs['id'] = msgid 16 | 17 | return GObject.new(tp, **kwargs) 18 | 19 | def send(self, msgid, **kwargs): 20 | msg = self.create(msgid, **kwargs) 21 | self.send_message(msg) 22 | 23 | return msg 24 | 25 | MessageBus = override(MessageBus) 26 | __all__.append('MessageBus') 27 | 28 | class Message(GitgExt.Message): 29 | def __getattribute__(self, name): 30 | try: 31 | return GitgExt.Message.__getattribute__(self, name) 32 | except: 33 | return getattr(self.props, name) 34 | 35 | Message = override(Message) 36 | __all__.append('Message') 37 | 38 | # vi:ex:ts=4:et 39 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-action.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public interface Action : UIElement 24 | { 25 | public virtual void populate_menu(Gtk.Menu menu) 26 | { 27 | if (!available) 28 | { 29 | return; 30 | } 31 | 32 | var item = new Gtk.MenuItem.with_label(display_name); 33 | item.tooltip_text = description; 34 | 35 | if (enabled) 36 | { 37 | item.activate.connect(() => { 38 | activate(); 39 | }); 40 | } 41 | else 42 | { 43 | item.sensitive = false; 44 | } 45 | 46 | item.show(); 47 | menu.append(item); 48 | } 49 | 50 | public virtual async bool fetch(){ 51 | return true; 52 | } 53 | } 54 | 55 | } 56 | 57 | // ex: ts=4 noet 58 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-activity.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | /** 24 | * gitg Activity interface. 25 | * 26 | * The Activity interface can be implemented to provide a main activity in 27 | * gitg. An example of such activities are the builtin History and 28 | * Commit activities. 29 | */ 30 | public interface Activity : Object, UIElement 31 | { 32 | /** 33 | * Whether the activity is the default for the specified action. 34 | * 35 | * @param action the action. 36 | * 37 | * @return true if the activity is the default activity for @action, 38 | * false otherwise. 39 | */ 40 | public virtual bool is_default_for(string action) 41 | { 42 | return false; 43 | } 44 | 45 | /** 46 | * Activity receives a key event to process it. 47 | * 48 | * @param event the key event 49 | * 50 | * @return true if the key event is consumed by this activity. 51 | */ 52 | public virtual bool on_key_pressed (Gdk.EventKey event) 53 | { 54 | return false; 55 | } 56 | } 57 | 58 | } 59 | 60 | // ex: ts=4 noet 61 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-assembly-info.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | [CCode (gir_namespace = "GitgExt", gir_version = "1.0")] 21 | namespace GitgExt {} 22 | 23 | // ex:set ts=4 noet 24 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-command-line.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | public interface CommandLine : Object 23 | { 24 | public abstract OptionGroup get_option_group(); 25 | public abstract void parse_finished(); 26 | public abstract void apply(GitgExt.Application application); 27 | } 28 | } 29 | 30 | // vi:ts=4 31 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-command-lines.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2015 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | public class CommandLines : Object 23 | { 24 | private CommandLine[] d_command_lines; 25 | 26 | public CommandLines(CommandLine[] command_lines) 27 | { 28 | d_command_lines = command_lines; 29 | } 30 | 31 | public T? get_for() 32 | { 33 | foreach (var cmd in d_command_lines) 34 | { 35 | if (cmd.get_type() == typeof(T)) 36 | { 37 | return (T)cmd; 38 | } 39 | } 40 | 41 | return null; 42 | } 43 | 44 | public void parse_finished() 45 | { 46 | foreach (var cmd in d_command_lines) 47 | { 48 | cmd.parse_finished(); 49 | } 50 | } 51 | 52 | public void apply(Application application) 53 | { 54 | foreach (var cmd in d_command_lines) 55 | { 56 | cmd.apply(application); 57 | } 58 | } 59 | } 60 | } 61 | 62 | // vi:ts=4 63 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-commit-action.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public interface CommitAction : Action 24 | { 25 | public abstract RefActionInterface action_interface { get; construct set; } 26 | public abstract Gitg.Commit commit { get; construct set; } 27 | public signal void finished(); 28 | } 29 | 30 | } 31 | 32 | // ex: ts=4 noet 33 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-history-panel.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | /** 24 | * Panel interfaces implemented to show additional details of selections in 25 | * the history. 26 | * 27 | * The panel interface can be implemented to show additional details of the 28 | * history activity. The panel will be shown in a split view below the history 29 | * when activated. Panels should implement the {@link UIElement.available} property to 30 | * indicate for which state of the application the panel is active. 31 | * 32 | * Each panel should have a unique id, a display name and an icon which will 33 | * be used in the interface to activate the panel. The {@link UIElement.widget} is 34 | * displayed when the panel is activated. 35 | * 36 | */ 37 | public interface HistoryPanel : Object, UIElement 38 | { 39 | /** 40 | * The history to which the panel belongs. This property is a construct 41 | * property and will be automatically set when an instance of the panel 42 | * is created. 43 | */ 44 | public abstract GitgExt.History? history { owned get; construct set; } 45 | } 46 | 47 | } 48 | 49 | // ex: ts=4 noet 50 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-history.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2013 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public delegate bool ForeachCommitSelectionFunc(Ggit.Commit object); 24 | 25 | public interface History : Object, Activity 26 | { 27 | 28 | public signal void selection_changed(); 29 | public abstract void foreach_selected(ForeachCommitSelectionFunc func); 30 | 31 | public abstract void select(Gitg.Commit commit); 32 | } 33 | 34 | } 35 | 36 | // ex: ts=4 noet 37 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-message.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public abstract class Message : Object 24 | { 25 | private MessageId d_id; 26 | 27 | public MessageId id 28 | { 29 | construct set 30 | { 31 | d_id = value.copy(); 32 | } 33 | get 34 | { 35 | return d_id; 36 | } 37 | } 38 | 39 | public bool has(string propname) 40 | { 41 | return get_class().find_property(propname) != null; 42 | } 43 | 44 | public static bool type_has(Type type, string propname) 45 | { 46 | return ((ObjectClass)type.class_ref()).find_property(propname) != null; 47 | } 48 | 49 | public static bool type_check(Type type, string propname, Type value_type) 50 | { 51 | ParamSpec? spec = ((ObjectClass)type.class_ref()).find_property(propname); 52 | 53 | return (spec != null && spec.value_type == value_type); 54 | } 55 | } 56 | 57 | } 58 | 59 | // ex:set ts=4 noet: 60 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-notification.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2015 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public interface Notification : Object 24 | { 25 | public signal void close(uint delay = 0); 26 | public abstract Gtk.Widget? widget { owned get; } 27 | } 28 | 29 | } 30 | 31 | // ex:set ts=4 noet: 32 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-notifications.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public interface Notifications : Object 24 | { 25 | public abstract void add(Notification notification); 26 | public abstract void remove(Notification notification, uint delay); 27 | } 28 | 29 | } 30 | 31 | // ex:set ts=4 noet: 32 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-preferences.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | public interface Preferences : Object 23 | { 24 | public abstract string id { owned get; } 25 | public abstract string display_name { owned get; } 26 | public abstract Gtk.Widget widget { owned get; } 27 | } 28 | } 29 | 30 | // vi:ts=4 31 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-ref-action-interface.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public delegate void RefNameEditingDone(string new_name, bool cancelled); 24 | 25 | public interface RefActionInterface : Object 26 | { 27 | public abstract Application application { owned get; construct set; } 28 | public abstract Gee.List references { owned get; } 29 | 30 | public abstract void add_ref(Gitg.Ref reference); 31 | public abstract void remove_ref(Gitg.Ref reference); 32 | public abstract void replace_ref(Gitg.Ref old_ref, Gitg.Ref new_ref); 33 | public abstract void set_busy(Gitg.Ref reference, bool busy); 34 | public abstract void edit_ref_name(Gitg.Ref reference, owned RefNameEditingDone callback); 35 | public abstract void refresh(); 36 | } 37 | 38 | } 39 | 40 | // ex: ts=4 noet 41 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-ref-action.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public interface RefAction : Action 24 | { 25 | public abstract RefActionInterface action_interface { get; construct set; } 26 | public abstract Gitg.Ref reference { get; construct set; } 27 | public signal void finished(); 28 | } 29 | 30 | } 31 | 32 | // ex: ts=4 noet 33 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-remote-lookup.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public interface RemoteLookup : Object 24 | { 25 | public abstract Gitg.Remote? lookup(string? name); 26 | } 27 | 28 | } 29 | 30 | // ex:set ts=4 noet: 31 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-searchable.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | /** 24 | * gitg Searchable interface. 25 | * 26 | * The Searchable interface can be implemented when an activity supports a 27 | * searching. 28 | */ 29 | public interface Searchable : Object, Activity 30 | { 31 | public abstract string search_text { owned get; set; } 32 | public abstract bool search_visible { get; set; } 33 | public abstract bool search_available { get; } 34 | public abstract Gtk.Entry? search_entry { set; } 35 | public virtual void search_move(string key, bool up) {} 36 | public virtual bool show_buttons() { return false; } 37 | } 38 | 39 | } 40 | 41 | // ex: ts=4 noet 42 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-selectable.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public enum SelectionMode 24 | { 25 | NORMAL, 26 | SELECTION 27 | } 28 | 29 | /** 30 | * gitg Selectable interface. 31 | * 32 | * The Selectable interface can be implemented when an activity supports a 33 | * selection mode. 34 | */ 35 | public interface Selectable : Object, Activity 36 | { 37 | public abstract SelectionMode selectable_mode { get; set; } 38 | public abstract bool selectable_available { get; } 39 | public abstract string selectable_mode_tooltip { owned get; } 40 | 41 | public abstract Gtk.Widget? action_widget { owned get; } 42 | 43 | } 44 | 45 | } 46 | 47 | // ex: ts=4 noet 48 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-ui.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | public class UI 23 | { 24 | public static Gee.HashMap? from_builder(string path, ...) 25 | { 26 | var builder = new Gtk.Builder(); 27 | 28 | try 29 | { 30 | builder.add_from_resource("/org/gnome/gitg/" + path); 31 | } 32 | catch (Error e) 33 | { 34 | warning("Failed to load ui: %s", e.message); 35 | return null; 36 | } 37 | 38 | Gee.HashMap ret = new Gee.HashMap(); 39 | 40 | var l = va_list(); 41 | 42 | while (true) 43 | { 44 | string? id = l.arg(); 45 | 46 | if (id == null) 47 | { 48 | break; 49 | } 50 | 51 | ret[id] = builder.get_object(id); 52 | } 53 | 54 | return ret; 55 | } 56 | } 57 | } 58 | 59 | // vi:ts=4 60 | -------------------------------------------------------------------------------- /libgitg-ext/gitg-ext-user-query.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2014 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace GitgExt 21 | { 22 | 23 | public class UserQueryResponse : Object 24 | { 25 | public string text; 26 | public Gtk.ResponseType response_type; 27 | 28 | public UserQueryResponse(string text, Gtk.ResponseType response_type) 29 | { 30 | this.text = text; 31 | this.response_type = response_type; 32 | } 33 | } 34 | 35 | public class UserQuery : Object 36 | { 37 | public string title { get; set; } 38 | public string message { get; set; } 39 | public Gtk.MessageType message_type { get; set; } 40 | public Gtk.ResponseType default_response { get; set; default = Gtk.ResponseType.CLOSE; } 41 | public UserQueryResponse[] _responses; 42 | 43 | public UserQueryResponse[] get_responses() { 44 | return _responses; 45 | } 46 | 47 | public void set_responses(UserQueryResponse[] value) { 48 | _responses = value; 49 | } 50 | 51 | public bool default_is_destructive { get; set; } 52 | public bool message_use_markup { get; set; } 53 | 54 | public signal void quit(); 55 | public signal bool response(Gtk.ResponseType response_type); 56 | 57 | public UserQuery.full(string title, string message, Gtk.MessageType message_type, ...) 58 | { 59 | Object(title: title, message: message, message_type: message_type); 60 | 61 | var l = va_list(); 62 | var resps = new UserQueryResponse[0]; 63 | 64 | while (true) { 65 | string? text = l.arg(); 66 | 67 | if (text == null) { 68 | break; 69 | } 70 | 71 | resps += new UserQueryResponse(text, l.arg()); 72 | } 73 | 74 | set_responses(resps); 75 | 76 | if (resps.length > 0) { 77 | default_response = resps[resps.length - 1].response_type; 78 | } 79 | } 80 | } 81 | 82 | } 83 | 84 | // ex:set ts=4 noet: 85 | -------------------------------------------------------------------------------- /libgitg-ext/resources/resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /libgitg.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | *; 4 | local: 5 | _.*; 6 | }; 7 | -------------------------------------------------------------------------------- /libgitg/gitg-assembly-info.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | [CCode (gir_namespace = "Gitg", gir_version = "1.0")] 21 | namespace Gitg {} 22 | 23 | // ex:set ts=4 noet 24 | -------------------------------------------------------------------------------- /libgitg/gitg-async.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2013 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | public class Async 24 | { 25 | public delegate void ThreadFunc() throws Error; 26 | 27 | public static async void thread(ThreadFunc func) throws Error 28 | { 29 | SourceFunc callback = thread.callback; 30 | Error? err = null; 31 | 32 | var t = new Thread.try("gitg-async", () => { 33 | try 34 | { 35 | func(); 36 | } 37 | catch (Error e) 38 | { 39 | err = e; 40 | } 41 | 42 | Idle.add((owned)callback); 43 | return null; 44 | }); 45 | 46 | yield; 47 | 48 | t.join(); 49 | 50 | if (err != null) 51 | { 52 | throw err; 53 | } 54 | } 55 | 56 | public static async void thread_try(ThreadFunc func) 57 | { 58 | try 59 | { 60 | yield thread(func); 61 | } catch {} 62 | } 63 | } 64 | 65 | } 66 | 67 | // ex:set ts=4 noet 68 | -------------------------------------------------------------------------------- /libgitg/gitg-branch-base.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | namespace Gitg 20 | { 21 | 22 | public class BranchBase : Ggit.Branch, Ref, Branch 23 | { 24 | protected ParsedRefName d_parsed_name { get; set; } 25 | 26 | protected List? d_pushes { get; owned set; } 27 | 28 | public RefState state { get; set; } 29 | public bool working { get; set; } 30 | 31 | public new Gitg.Repository get_owner() 32 | { 33 | return (Gitg.Repository)base.get_owner(); 34 | } 35 | 36 | public new Gitg.Ref get_upstream() throws Error 37 | { 38 | return (Gitg.Ref)base.get_upstream(); 39 | } 40 | } 41 | 42 | } 43 | 44 | // ex:set ts=4 noet 45 | -------------------------------------------------------------------------------- /libgitg/gitg-branch.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | namespace Gitg 20 | { 21 | 22 | public interface Branch : Ggit.Branch, Ref 23 | { 24 | public abstract new Gitg.Ref get_upstream() throws Error; 25 | } 26 | 27 | } 28 | 29 | // ex:set ts=4 noet 30 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-image-difference.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | class Gitg.DiffImageDifference : DiffImageComposite 21 | { 22 | protected override bool draw(Cairo.Context cr) 23 | { 24 | base.draw(cr); 25 | 26 | var window = get_window(); 27 | 28 | Gtk.Allocation alloc; 29 | get_allocation(out alloc); 30 | 31 | int image_width, image_height; 32 | get_sizing(alloc.width, out image_width, out image_height); 33 | 34 | var old_surface = cache.get_old_surface(window); 35 | var new_surface = cache.get_new_surface(window); 36 | 37 | int x = (alloc.width - image_width) / 2; 38 | int y = 0; 39 | 40 | if (old_surface != null) 41 | { 42 | cr.set_source_surface(old_surface, x, y); 43 | cr.paint(); 44 | } 45 | 46 | if (new_surface != null) 47 | { 48 | cr.save(); 49 | { 50 | cr.set_operator(Cairo.Operator.DIFFERENCE); 51 | cr.set_source_surface(new_surface, x, y); 52 | cr.paint(); 53 | } 54 | cr.restore(); 55 | } 56 | 57 | return true; 58 | } 59 | 60 | protected override void realize() 61 | { 62 | base.realize(); 63 | queue_resize(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-image-overlay.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | class Gitg.DiffImageOverlay : DiffImageComposite 21 | { 22 | private double d_alpha; 23 | 24 | public double alpha 25 | { 26 | get { return d_alpha; } 27 | 28 | set 29 | { 30 | var newalpha = double.max(0, double.min(value, 1)); 31 | 32 | if (newalpha != d_alpha) 33 | { 34 | d_alpha = newalpha; 35 | queue_draw(); 36 | } 37 | } 38 | } 39 | 40 | construct 41 | { 42 | alpha = 0.5; 43 | } 44 | 45 | protected override bool draw(Cairo.Context cr) 46 | { 47 | base.draw(cr); 48 | 49 | var window = get_window(); 50 | 51 | Gtk.Allocation alloc; 52 | get_allocation(out alloc); 53 | 54 | int image_width, image_height; 55 | get_sizing(alloc.width, out image_width, out image_height); 56 | 57 | var old_surface = cache.get_old_surface(window); 58 | var new_surface = cache.get_new_surface(window); 59 | 60 | int x = (alloc.width - image_width) / 2; 61 | int y = 0; 62 | 63 | if (old_surface != null && d_alpha != 1) 64 | { 65 | cr.set_source_surface(old_surface, x, y); 66 | cr.paint_with_alpha(1 - d_alpha); 67 | } 68 | 69 | if (new_surface != null && d_alpha != 0) 70 | { 71 | cr.set_source_surface(new_surface, x, y); 72 | cr.paint_with_alpha(d_alpha); 73 | } 74 | 75 | return true; 76 | } 77 | 78 | protected override void realize() 79 | { 80 | base.realize(); 81 | queue_resize(); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-image-slider.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | class Gitg.DiffImageSlider : DiffImageComposite 21 | { 22 | private double d_position; 23 | 24 | public double position 25 | { 26 | get { return d_position; } 27 | 28 | set 29 | { 30 | var newpos = double.max(0, double.min(value, 1)); 31 | 32 | if (newpos != d_position) 33 | { 34 | d_position = newpos; 35 | queue_draw(); 36 | } 37 | } 38 | } 39 | 40 | construct 41 | { 42 | position = 0.5; 43 | } 44 | 45 | protected override bool draw(Cairo.Context cr) 46 | { 47 | base.draw(cr); 48 | 49 | var window = get_window(); 50 | 51 | Gtk.Allocation alloc; 52 | get_allocation(out alloc); 53 | 54 | int image_width, image_height; 55 | get_sizing(alloc.width, out image_width, out image_height); 56 | 57 | var old_surface = cache.get_old_surface(window); 58 | var new_surface = cache.get_new_surface(window); 59 | 60 | int x = (alloc.width - image_width) / 2; 61 | int y = 0; 62 | 63 | int pos = (int)(image_width * position); 64 | 65 | if (old_surface != null) 66 | { 67 | cr.save(); 68 | { 69 | cr.rectangle(x, y, pos, image_height); 70 | cr.clip(); 71 | cr.set_source_surface(old_surface, x, y); 72 | cr.paint(); 73 | } 74 | cr.restore(); 75 | } 76 | 77 | if (new_surface != null) 78 | { 79 | cr.save(); 80 | { 81 | cr.rectangle(x + pos, y, image_width - pos, image_height); 82 | cr.clip(); 83 | cr.set_source_surface(new_surface, x, y); 84 | cr.paint(); 85 | } 86 | cr.restore(); 87 | } 88 | 89 | return true; 90 | } 91 | 92 | protected override void realize() 93 | { 94 | base.realize(); 95 | queue_resize(); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-image-surface-cache.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | interface Gitg.DiffImageSurfaceCache : Object 21 | { 22 | public abstract Gdk.Pixbuf? old_pixbuf { get; construct set; } 23 | public abstract Gdk.Pixbuf? new_pixbuf { get; construct set; } 24 | 25 | public abstract Gdk.Window window { get; construct set; } 26 | 27 | public abstract Cairo.Surface? get_old_surface(Gdk.Window window); 28 | public abstract Cairo.Surface? get_new_surface(Gdk.Window window); 29 | } 30 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-selectable.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | interface Gitg.DiffSelectable : Object 21 | { 22 | public abstract bool has_selection { get; } 23 | public abstract bool can_select { get; construct set; } 24 | 25 | public abstract PatchSet selection { owned get; } 26 | public abstract void clear_selection (); 27 | } 28 | 29 | // ex:ts=4 noet 30 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-view-file-renderer-binary.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | [GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-diff-view-file-renderer-binary.ui")] 21 | class Gitg.DiffViewFileRendererBinary : Gtk.Grid, DiffViewFileRenderer 22 | { 23 | public void add_hunk(Ggit.DiffHunk hunk, Gee.ArrayList lines) 24 | { 25 | } 26 | } 27 | 28 | // ex:ts=4 noet 29 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-view-file-renderer-textable.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | interface Gitg.DiffViewFileRendererTextable : DiffSelectable, DiffViewFileRenderer 21 | { 22 | public abstract bool wrap_lines { get; set; } 23 | public abstract new int tab_width { get; set; } 24 | public abstract int maxlines { get; set; } 25 | public abstract bool highlight { get; construct set; } 26 | } 27 | 28 | // ex:ts=4 noet 29 | -------------------------------------------------------------------------------- /libgitg/gitg-diff-view-file-renderer.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2016 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | interface Gitg.DiffViewFileRenderer : Gtk.Widget 21 | { 22 | public abstract void add_hunk(Ggit.DiffHunk hunk, Gee.ArrayList lines); 23 | } 24 | 25 | // ex:ts=4 noet 26 | -------------------------------------------------------------------------------- /libgitg/gitg-gpg-utils.vala: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This file is part of gitg 4 | * 5 | * Copyright (C) 2022 - Alberto Fanjul 6 | * 7 | * gitg is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * gitg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with gitg. If not, see . 19 | */ 20 | 21 | using GPG; 22 | 23 | namespace Gitg 24 | { 25 | 26 | public class GPGUtils 27 | { 28 | public static string sign_commit_object(string commit_content, 29 | string signing_key) throws Error 30 | { 31 | check_version(); 32 | Data plain_data; 33 | Data signed_data; 34 | Data.create(out signed_data); 35 | Data.create_from_memory(out plain_data, commit_content.data, false); 36 | Context context; 37 | Context.Context(out context); 38 | context.set_armor(true); 39 | Key key; 40 | context.get_key(signing_key, out key, true); 41 | if (key != null) 42 | context.signers_add(key); 43 | context.op_sign(plain_data, signed_data, SigMode.DETACH); 44 | return get_string_from_data(signed_data); 45 | } 46 | 47 | private static string get_string_from_data(Data data) { 48 | data.seek(0); 49 | uint8[] buf = new uint8[256]; 50 | ssize_t? len = null; 51 | string res = ""; 52 | do { 53 | len = data.read(buf); 54 | if (len > 0) { 55 | string part = (string) buf; 56 | part = part.substring(0, (long) len); 57 | res += part; 58 | } 59 | } while (len > 0); 60 | return res; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /libgitg/gitg-init.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | public errordomain InitError 24 | { 25 | THREADS_UNSAFE 26 | } 27 | 28 | private static bool gitg_inited = false; 29 | private static InitError? gitg_initerr = null; 30 | 31 | public void init() throws Error 32 | { 33 | if (gitg_inited) 34 | { 35 | if (gitg_initerr != null) 36 | { 37 | throw gitg_initerr; 38 | } 39 | 40 | return; 41 | } 42 | 43 | gitg_inited = true; 44 | 45 | if ((Ggit.get_features() & Ggit.FeatureFlags.THREADS) == 0) 46 | { 47 | gitg_initerr = new InitError.THREADS_UNSAFE("no thread support"); 48 | 49 | warning("libgit2 must be built with threading support in order to run gitg"); 50 | throw gitg_initerr; 51 | } 52 | 53 | Ggit.init(); 54 | 55 | var factory = Ggit.ObjectFactory.get_default(); 56 | 57 | factory.register(typeof(Ggit.Repository), 58 | typeof(Gitg.Repository)); 59 | 60 | factory.register(typeof(Ggit.Ref), 61 | typeof(Gitg.RefBase)); 62 | 63 | factory.register(typeof(Ggit.Branch), 64 | typeof(Gitg.BranchBase)); 65 | 66 | factory.register(typeof(Ggit.Commit), 67 | typeof(Gitg.Commit)); 68 | 69 | factory.register(typeof(Ggit.Remote), 70 | typeof(Gitg.Remote)); 71 | 72 | // Add our own css provider 73 | Gtk.CssProvider? provider = Gitg.Resource.load_css("libgitg-style.css"); 74 | 75 | if (provider != null) 76 | { 77 | Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), 78 | provider, 79 | 600); 80 | } 81 | 82 | } 83 | 84 | } 85 | 86 | // ex:set ts=4 noet 87 | -------------------------------------------------------------------------------- /libgitg/gitg-lane.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | [Flags] 24 | public enum LaneTag 25 | { 26 | NONE = 0, 27 | START = 1 << 0, 28 | END = 1 << 1, 29 | SIGN_STASH = 1 << 2, 30 | SIGN_STAGED = 1 << 3, 31 | SIGN_UNSTAGED = 1 << 4, 32 | HIDDEN = 1 << 5 33 | } 34 | 35 | public class Lane : Object 36 | { 37 | public Color color; 38 | public SList from; 39 | public LaneTag tag; 40 | public Ggit.OId? boundary_id; 41 | 42 | public Lane() 43 | { 44 | this.with_color(null); 45 | } 46 | 47 | public Lane.with_color(Color? color) 48 | { 49 | if (color != null) 50 | { 51 | this.color = color; 52 | } 53 | else 54 | { 55 | this.color = Color.next(); 56 | } 57 | } 58 | 59 | public Lane copy() 60 | { 61 | Lane ret = new Lane.with_color(color); 62 | ret.from = from.copy(); 63 | ret.tag = tag; 64 | ret.boundary_id = boundary_id; 65 | 66 | return ret; 67 | } 68 | 69 | public Lane dup() 70 | { 71 | Lane ret = new Lane.with_color(color.copy()); 72 | ret.from = from.copy(); 73 | ret.tag = tag; 74 | ret.boundary_id = boundary_id; 75 | 76 | return ret; 77 | } 78 | } 79 | 80 | } 81 | 82 | // ex:set ts=4 noet 83 | -------------------------------------------------------------------------------- /libgitg/gitg-ref-base.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | namespace Gitg 20 | { 21 | 22 | public class RefBase : Ggit.Ref, Ref 23 | { 24 | protected ParsedRefName d_parsed_name { get; set; } 25 | 26 | protected List? d_pushes { get; owned set; } 27 | 28 | public RefState state { get; set; } 29 | public bool working { get; set; } 30 | 31 | public new Gitg.Repository get_owner() 32 | { 33 | return (Gitg.Repository)base.get_owner(); 34 | } 35 | } 36 | 37 | } 38 | 39 | // ex:set ts=4 noet 40 | -------------------------------------------------------------------------------- /libgitg/gitg-resource.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | public class Gitg.Resource 21 | { 22 | public static Gtk.CssProvider? load_css(string id) 23 | { 24 | var provider = new Gtk.CssProvider(); 25 | var f = File.new_for_uri("resource:///org/gnome/gitg/ui/" + id); 26 | 27 | try 28 | { 29 | provider.load_from_file(f); 30 | } 31 | catch (Error e) 32 | { 33 | warning("Error while loading resource: %s", e.message); 34 | return null; 35 | } 36 | 37 | return provider; 38 | } 39 | } 40 | 41 | // ex: ts=4 noet 42 | -------------------------------------------------------------------------------- /libgitg/gitg-theme.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2018 - Jente Hidskes 4 | * 5 | * gitg is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * gitg is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with gitg. If not, see . 17 | */ 18 | 19 | namespace Gitg 20 | { 21 | 22 | public class Theme : Gtk.Widget 23 | { 24 | private static GLib.Once _instance; 25 | 26 | public static unowned Theme instance () 27 | { 28 | return _instance.once (() => { return new Theme (); }); 29 | } 30 | 31 | public bool is_theme_dark() 32 | { 33 | var settings = Gtk.Settings.get_default(); 34 | var theme = Environment.get_variable("GTK_THEME"); 35 | 36 | var dark = settings.gtk_application_prefer_dark_theme || (theme != null && theme.has_suffix(":dark")); 37 | 38 | if (!dark) { 39 | var stylecontext = get_style_context(); 40 | Gdk.RGBA rgba; 41 | var background_set = stylecontext.lookup_color("theme_bg_color", out rgba); 42 | 43 | if (background_set && rgba.red + rgba.green + rgba.blue < 1.0) 44 | { 45 | dark = true; 46 | } 47 | } 48 | 49 | return dark; 50 | } 51 | } 52 | 53 | } 54 | 55 | // ex:ts=4 noet 56 | -------------------------------------------------------------------------------- /libgitg/gitg-utils.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2015 - Jesse van den Kieboom 4 | * 5 | * gitg is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * gitg is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with gitg. If not, see . 17 | */ 18 | 19 | namespace Gitg 20 | { 21 | 22 | public class Utils 23 | { 24 | public static string replace_home_dir_with_tilde(File file) 25 | { 26 | var name = file.get_parse_name(); 27 | var homedir = Environment.get_home_dir(); 28 | 29 | if (homedir != null) 30 | { 31 | try 32 | { 33 | var hd = Filename.to_utf8(homedir, -1, null, null); 34 | 35 | if (hd == name) 36 | { 37 | name = "~/"; 38 | } 39 | else 40 | { 41 | if (name.has_prefix(hd + "/")) 42 | { 43 | name = "~" + name[hd.length:name.length]; 44 | } 45 | } 46 | } catch {} 47 | } 48 | 49 | return name; 50 | } 51 | 52 | public static string expand_home_dir(string path) 53 | { 54 | string? homedir = null; 55 | int pos = -1; 56 | 57 | if (path.has_prefix("~/")) 58 | { 59 | homedir = PlatformSupport.get_user_home_dir(); 60 | pos = 1; 61 | } 62 | else if (path.has_prefix("~")) 63 | { 64 | pos = path.index_of_char('/'); 65 | var user = path[1:pos]; 66 | 67 | homedir = PlatformSupport.get_user_home_dir(user); 68 | } 69 | 70 | if (homedir != null) 71 | { 72 | return Path.build_filename(homedir, path.substring(pos + 1)); 73 | } 74 | 75 | return path; 76 | } 77 | } 78 | 79 | } 80 | 81 | // ex:ts=4 noet 82 | -------------------------------------------------------------------------------- /libgitg/resources/resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ui/gitg-repository-list-box-row.ui 5 | ui/gitg-authentication-dialog.ui 6 | ui/gitg-diff-view.ui 7 | ui/gitg-diff-view-file.ui 8 | ui/gitg-diff-view-file-renderer-image.ui 9 | ui/gitg-diff-view-file-renderer-text.ui 10 | ui/gitg-diff-view-file-renderer-binary.ui 11 | ui/gitg-diff-view-file-renderer-text-split.ui 12 | ui/gitg-diff-view-options.ui 13 | ui/gitg-diff-view-options-spacing.ui 14 | ui/gitg-diff-view-commit-details.ui 15 | ui/gitg-sidebar.ui 16 | 17 | ui/libgitg-style.css 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /libgitg/resources/ui/gitg-diff-view-file-renderer-binary.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 22 | 23 | -------------------------------------------------------------------------------- /libgitg/resources/ui/gitg-diff-view-file-renderer-text-split.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 35 | 36 | -------------------------------------------------------------------------------- /libgitg/resources/ui/gitg-diff-view-file-renderer-text.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | False 21 | False 22 | 23 | 24 | -------------------------------------------------------------------------------- /libgitg/resources/ui/gitg-sidebar.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('glade_catalog', type: 'boolean', value: true, description: 'Install a glade catalog file') 2 | option('python', type: 'boolean', value: true, description: 'Build with python support') 3 | option('deprecations', type: 'boolean', value: false, description: 'warn about deprecated usages') 4 | option('docs', type: 'boolean', value: false, description: 'enable generating documentation') 5 | option('profile', type: 'combo', choices: ['default', 'development'], value: 'default') 6 | -------------------------------------------------------------------------------- /meson_post_install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import glob 4 | import os 5 | import re 6 | import subprocess 7 | import sys 8 | 9 | if not os.environ.get('DESTDIR'): 10 | gitg_name = sys.argv[1] 11 | datadir = sys.argv[2] 12 | icondir = os.path.join(datadir, 'icons', 'hicolor') 13 | 14 | name_pattern = re.compile('hicolor_(?:apps)_(?:\d+x\d+|scalable)_(.*)') 15 | search_pattern = '/**/hicolor_*' 16 | 17 | [os.rename(file, os.path.join(os.path.dirname(file), name_pattern.search(file).group(1))) 18 | for file in glob.glob(icondir + search_pattern, recursive=True)] 19 | 20 | print('Update icon cache...') 21 | subprocess.call(['gtk-update-icon-cache', '-f', '-t', '-q', icondir]) 22 | 23 | icondir = os.path.join(datadir, gitg_name, 'icons', 'hicolor') 24 | subprocess.call(['gtk-update-icon-cache', '-f', '-t', '-q', icondir]) 25 | 26 | schemadir = os.path.join(datadir, 'glib-2.0', 'schemas') 27 | print('Compiling gsettings schemas...') 28 | subprocess.call(['glib-compile-schemas', schemadir]) 29 | 30 | if sys.argv[2] == 'python': 31 | print('Byte-compiling python modules...') 32 | subprocess.call(['python3', '-m', 'compileall', '-f', '-q', sys.argv[3]]) 33 | 34 | print('Byte-compiling python modules (optimized versions) ...') 35 | subprocess.call(['python3', '-O', '-m', 'compileall', '-f', '-q', sys.argv[3]]) 36 | -------------------------------------------------------------------------------- /osx/.gitignore: -------------------------------------------------------------------------------- 1 | /Gitg.app 2 | -------------------------------------------------------------------------------- /osx/Taps/gitg/atk.rb: -------------------------------------------------------------------------------- 1 | class Atk < Formula 2 | desc "GNOME accessibility toolkit" 3 | homepage "https://library.gnome.org/devel/atk/" 4 | url "https://download.gnome.org/sources/atk/2.20/atk-2.20.0.tar.xz" 5 | sha256 "493a50f6c4a025f588d380a551ec277e070b28a82e63ef8e3c06b3ee7c1238f0" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "gnome/gitg/glib" 9 | depends_on "gnome/gitg/gobject-introspection" 10 | 11 | option :universal 12 | 13 | def install 14 | ENV.universal_binary if build.universal? 15 | system "./configure", "--disable-dependency-tracking", 16 | "--prefix=#{prefix}", 17 | "--enable-introspection=yes" 18 | system "make" 19 | system "make", "install" 20 | end 21 | 22 | test do 23 | (testpath/"test.c").write <<-EOS.undent 24 | #include 25 | 26 | int main(int argc, char *argv[]) { 27 | const gchar *version = atk_get_version(); 28 | return 0; 29 | } 30 | EOS 31 | gettext = Formula["gettext"] 32 | glib = Formula["glib"] 33 | flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split 34 | flags += %W[ 35 | -I#{gettext.opt_include} 36 | -I#{glib.opt_include}/glib-2.0 37 | -I#{glib.opt_lib}/glib-2.0/include 38 | -I#{include}/atk-1.0 39 | -L#{gettext.opt_lib} 40 | -L#{glib.opt_lib} 41 | -L#{lib} 42 | -latk-1.0 43 | -lglib-2.0 44 | -lgobject-2.0 45 | -lintl 46 | ] 47 | system ENV.cc, "test.c", "-o", "test", *flags 48 | system "./test" 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /osx/Taps/gitg/enchant.rb: -------------------------------------------------------------------------------- 1 | class Enchant < Formula 2 | desc "Spellchecker wrapping library" 3 | homepage "http://www.abisource.com/projects/enchant/" 4 | url "http://www.abisource.com/downloads/enchant/1.6.0/enchant-1.6.0.tar.gz" 5 | sha256 "2fac9e7be7e9424b2c5570d8affe568db39f7572c10ed48d4e13cddf03f7097f" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on :python => :optional 9 | depends_on "gnome/gitg/glib" 10 | depends_on "aspell" 11 | 12 | # https://pythonhosted.org/pyenchant/ 13 | resource "pyenchant" do 14 | url "https://pypi.python.org/packages/source/p/pyenchant/pyenchant-1.6.5.tar.gz" 15 | sha256 "623f332a9fbb70ae6c9c2d0d4e7f7bae5922d36ba0fe34be8e32df32ebbb4f84" 16 | end 17 | 18 | def install 19 | system "./configure", "--disable-dependency-tracking", 20 | "--prefix=#{prefix}", 21 | "--disable-ispell", 22 | "--disable-myspell" 23 | system "make", "install" 24 | 25 | if build.with? "python" 26 | resource("pyenchant").stage do 27 | # Don't download and install distribute now 28 | inreplace "setup.py", "distribute_setup.use_setuptools()", "" 29 | ENV["PYENCHANT_LIBRARY_PATH"] = lib/"libenchant.dylib" 30 | system "python", "setup.py", "install", "--prefix=#{prefix}", 31 | "--single-version-externally-managed", 32 | "--record=installed.txt" 33 | end 34 | end 35 | end 36 | 37 | test do 38 | text = "Teh quikc brwon fox iumpz ovr teh lAzy d0g" 39 | enchant_result = text.sub("fox ", "").split.join("\n") 40 | file = "test.txt" 41 | (testpath/file).write text 42 | assert_equal enchant_result, shell_output("#{bin}/enchant -l #{file}").chomp 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /osx/Taps/gitg/gdk-pixbuf.rb: -------------------------------------------------------------------------------- 1 | class GdkPixbuf < Formula 2 | desc "Toolkit for image loading and pixel buffer manipulation" 3 | homepage "http://gtk.org" 4 | url "https://download.gnome.org/sources/gdk-pixbuf/2.34/gdk-pixbuf-2.34.0.tar.xz" 5 | sha256 "d55e5b383ee219bd0e23bf6ed4427d56a7db5379729a6e3e0a0e0eba9a8d8879" 6 | 7 | option :universal 8 | 9 | depends_on "pkg-config" => :build 10 | depends_on "gnome/gitg/glib" 11 | depends_on "jpeg" 12 | depends_on "libtiff" 13 | depends_on "libpng" 14 | depends_on "gnome/gitg/gobject-introspection" 15 | 16 | # 'loaders.cache' must be writable by other packages 17 | skip_clean "lib/gdk-pixbuf-2.0" 18 | 19 | def install 20 | ENV.universal_binary if build.universal? 21 | ENV.append_to_cflags "-DGDK_PIXBUF_LIBDIR=\\\"#{HOMEBREW_PREFIX}/lib\\\"" 22 | system "./configure", "--disable-dependency-tracking", 23 | "--disable-maintainer-mode", 24 | "--enable-debug=no", 25 | "--prefix=#{prefix}", 26 | "--enable-introspection=yes", 27 | "--disable-Bsymbolic", 28 | "--without-gdiplus" 29 | system "make" 30 | system "make", "install" 31 | 32 | # Other packages should use the top-level modules directory 33 | # rather than dumping their files into the gdk-pixbuf keg. 34 | inreplace lib/"pkgconfig/gdk-pixbuf-2.0.pc" do |s| 35 | libv = s.get_make_var "gdk_pixbuf_binary_version" 36 | s.change_make_var! "gdk_pixbuf_binarydir", 37 | HOMEBREW_PREFIX/"lib/gdk-pixbuf-2.0"/libv 38 | end 39 | 40 | # Remove the cache. We will regenerate it in post_install 41 | (lib/"gdk-pixbuf-2.0/2.10.0/loaders.cache").unlink 42 | end 43 | 44 | def post_install 45 | # Change the version directory below with any future update 46 | ENV["GDK_PIXBUF_MODULEDIR"]="#{HOMEBREW_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders" 47 | system "#{bin}/gdk-pixbuf-query-loaders", "--update-cache" 48 | end 49 | 50 | def caveats; <<-EOS.undent 51 | Programs that require this module need to set the environment variable 52 | export GDK_PIXBUF_MODULEDIR="#{HOMEBREW_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders" 53 | If you need to manually update the query loader cache, set GDK_PIXBUF_MODULEDIR then run 54 | #{bin}/gdk-pixbuf-query-loaders --update-cache 55 | EOS 56 | end 57 | 58 | test do 59 | system bin/"gdk-pixbuf-csource", test_fixtures("test.png") 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /osx/Taps/gitg/gitg.rb: -------------------------------------------------------------------------------- 1 | class Gitg < Formula 2 | desc "git viewer" 3 | homepage "https://wiki.gnome.org/Apps/Gitg/" 4 | head "https://git.gnome.org/browse/gitg.git" 5 | 6 | depends_on "autoconf" => :build 7 | depends_on "automake" => :build 8 | depends_on "pkg-config" => :build 9 | depends_on "intltool" => :build 10 | depends_on "libtool" => :build 11 | depends_on "gnome/gitg/vala" => :build 12 | depends_on "gettext" 13 | depends_on "gnome/gitg/glib" 14 | depends_on "gnome/gitg/shared-mime-info" 15 | depends_on "gnome/gitg/gtk+3" => "with-quartz-relocation" 16 | depends_on "gnome/gitg/gtksourceview3" 17 | depends_on "gnome/gitg/libsecret" 18 | depends_on "gnome/gitg/libpeas" 19 | depends_on "gnome/gitg/gspell" 20 | depends_on "gnome/gitg/libgee" 21 | depends_on "gnome/gitg/gsettings-desktop-schemas" 22 | depends_on "gnome/gitg/libgit2-glib" => "with-vala" 23 | depends_on "gnome/gitg/gnome-icon-theme" 24 | depends_on "libxml2" 25 | 26 | def install 27 | system "./autogen.sh", "--disable-dependency-tracking", 28 | "--disable-maintainer-mode", 29 | "--disable-schemas-compile", 30 | "--prefix=#{prefix}" 31 | 32 | ENV.prepend_path "XDG_DATA_DIRS", "#{HOMEBREW_PREFIX}/share" 33 | 34 | ENV.prepend_path "GIRDIR", "#{HOMEBREW_PREFIX}/share/gir-1.0" 35 | ENV.prepend_path "VAPIDIR", "#{HOMEBREW_PREFIX}/share/vala/vapi" 36 | ENV.prepend_path "VAPIDIR", "#{HOMEBREW_PREFIX}/share/vala-0.30/vapi" 37 | 38 | system "make", "install" 39 | end 40 | 41 | def post_install 42 | system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas" 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /osx/Taps/gitg/gnome-icon-theme.rb: -------------------------------------------------------------------------------- 1 | class GnomeIconTheme < Formula 2 | desc "Icons for the GNOME project" 3 | homepage "https://developer.gnome.org" 4 | url "https://download.gnome.org/sources/adwaita-icon-theme/3.20/adwaita-icon-theme-3.20.tar.xz" 5 | sha256 "7a0a887349f340dd644032f89d81264b694c4b006bd51af1c2c368d431e7ae35" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "gettext" => :build 9 | depends_on "gnome/gitg/gtk+3" => :build # for gtk3-update-icon-cache 10 | depends_on "icon-naming-utils" => :build 11 | depends_on "intltool" => :build 12 | depends_on "gnome/gitg/librsvg" => :build 13 | 14 | def install 15 | system "./configure", "--disable-dependency-tracking", 16 | "--prefix=#{prefix}", 17 | "GTK_UPDATE_ICON_CACHE=#{Formula["gtk+3"].opt_bin}/gtk3-update-icon-cache" 18 | system "make", "install" 19 | end 20 | 21 | test do 22 | # This checks that a -symbolic png file generated from svg exists 23 | # and that a file created late in the install process exists. 24 | # Someone who understands GTK+3 could probably write better tests that 25 | # check if GTK+3 can find the icons. 26 | assert (share/"icons/Adwaita/96x96/status/weather-storm-symbolic.symbolic.png").exist? 27 | assert (share/"icons/Adwaita/index.theme").exist? 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /osx/Taps/gitg/gnutls.rb: -------------------------------------------------------------------------------- 1 | class Gnutls < Formula 2 | desc "GNU Transport Layer Security (TLS) Library" 3 | homepage "https://gnutls.org/" 4 | url "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.11.tar.xz" 5 | mirror "https://gnupg.org/ftp/gcrypt/gnutls/v3.4/gnutls-3.4.11.tar.xz" 6 | mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.4/gnutls-3.4.11.tar.xz" 7 | sha256 "70ef9c9f95822d363036c6e6b5479750e5b7fc34f50e750c3464a98ec65a9ab8" 8 | 9 | depends_on "pkg-config" => :build 10 | depends_on "libtasn1" 11 | depends_on "gmp" 12 | depends_on "nettle" 13 | 14 | fails_with :llvm do 15 | build 2326 16 | cause "Undefined symbols when linking" 17 | end 18 | 19 | def install 20 | args = %W[ 21 | --disable-dependency-tracking 22 | --disable-silent-rules 23 | --disable-static 24 | --prefix=#{prefix} 25 | --sysconfdir=#{etc} 26 | --with-default-trust-store-file=#{etc}/openssl/cert.pem 27 | --disable-heartbeat-support 28 | --without-p11-kit 29 | ] 30 | 31 | if build.with? "guile" 32 | args << "--enable-guile" 33 | args << "--with-guile-site-dir=no" 34 | end 35 | 36 | system "./configure", *args 37 | system "make", "install" 38 | 39 | # certtool shadows the OS X certtool utility 40 | mv bin/"certtool", bin/"gnutls-certtool" 41 | mv man1/"certtool.1", man1/"gnutls-certtool.1" 42 | end 43 | 44 | def post_install 45 | keychains = %w[ 46 | /System/Library/Keychains/SystemRootCertificates.keychain 47 | ] 48 | 49 | certs_list = `security find-certificate -a -p #{keychains.join(" ")}` 50 | certs = certs_list.scan( 51 | /-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m 52 | ) 53 | 54 | valid_certs = certs.select do |cert| 55 | IO.popen("openssl x509 -inform pem -checkend 0 -noout", "w") do |openssl_io| 56 | openssl_io.write(cert) 57 | openssl_io.close_write 58 | end 59 | 60 | $?.success? 61 | end 62 | 63 | openssldir = etc/"openssl" 64 | openssldir.mkpath 65 | (openssldir/"cert.pem").atomic_write(valid_certs.join("\n")) 66 | end 67 | 68 | test do 69 | system bin/"gnutls-cli", "--version" 70 | end 71 | end 72 | -------------------------------------------------------------------------------- /osx/Taps/gitg/gobject-introspection.rb: -------------------------------------------------------------------------------- 1 | class GobjectIntrospection < Formula 2 | desc "Generate interface introspection data for GObject libraries" 3 | homepage "https://live.gnome.org/GObjectIntrospection" 4 | url "https://download.gnome.org/sources/gobject-introspection/1.48/gobject-introspection-1.48.0.tar.xz" 5 | sha256 "fa275aaccdbfc91ec0bc9a6fd0562051acdba731e7d584b64a277fec60e75877" 6 | 7 | option :universal 8 | 9 | depends_on "pkg-config" => :run 10 | depends_on "gnome/gitg/glib" 11 | depends_on "libffi" 12 | 13 | resource "tutorial" do 14 | url "https://gist.github.com/7a0023656ccfe309337a.git", 15 | :revision => "499ac89f8a9ad17d250e907f74912159ea216416" 16 | end 17 | 18 | def install 19 | ENV["GI_SCANNER_DISABLE_CACHE"] = "true" 20 | ENV.universal_binary if build.universal? 21 | 22 | inreplace "giscanner/transformer.py", "/usr/share", "#{HOMEBREW_PREFIX}/share" 23 | 24 | inreplace "configure" do |s| 25 | s.change_make_var! "GOBJECT_INTROSPECTION_LIBDIR", "#{HOMEBREW_PREFIX}/lib" 26 | end 27 | 28 | system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" 29 | 30 | inreplace "config.h", 31 | "#define GIR_DIR \"#{share}/gir-1.0\"", 32 | "#define GIR_DIR \"#{HOMEBREW_PREFIX}/share/gir-1.0\"" 33 | 34 | system "make" 35 | system "make", "install" 36 | end 37 | 38 | test do 39 | ENV.prepend_path "PKG_CONFIG_PATH", Formula["libffi"].opt_lib/"pkgconfig" 40 | resource("tutorial").stage testpath 41 | system "make" 42 | assert (testpath/"Tut-0.1.typelib").exist? 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /osx/Taps/gitg/gsettings-desktop-schemas.rb: -------------------------------------------------------------------------------- 1 | class GsettingsDesktopSchemas < Formula 2 | desc "GSettings schemas for desktop components" 3 | homepage "https://download.gnome.org/sources/gsettings-desktop-schemas/" 4 | url "https://download.gnome.org/sources/gsettings-desktop-schemas/3.20/gsettings-desktop-schemas-3.20.0.tar.xz" 5 | sha256 "55a41b533c0ab955e0a36a84d73829451c88b027d8d719955d8f695c35c6d9c1" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "intltool" => :build 9 | depends_on "gnome/gitg/glib" 10 | depends_on "gnome/gitg/gobject-introspection" => :build 11 | depends_on "gettext" 12 | depends_on "libffi" 13 | 14 | def install 15 | system "./configure", "--disable-dependency-tracking", 16 | "--disable-silent-rules", 17 | "--prefix=#{prefix}", 18 | "--disable-schemas-compile", 19 | "--enable-introspection=yes" 20 | system "make", "install" 21 | end 22 | 23 | test do 24 | (testpath/"test.c").write <<-EOS.undent 25 | #include 26 | 27 | int main(int argc, char *argv[]) { 28 | return 0; 29 | } 30 | EOS 31 | system ENV.cc, "-I#{HOMEBREW_PREFIX}/include/gsettings-desktop-schemas", "test.c", "-o", "test" 32 | system "./test" 33 | end 34 | 35 | def post_install 36 | # manual schema compile step 37 | system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas" 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /osx/Taps/gitg/gtk-doc.rb: -------------------------------------------------------------------------------- 1 | class GtkDoc < Formula 2 | desc "GTK+ documentation tool" 3 | homepage "http://www.gtk.org/gtk-doc/" 4 | url "https://download.gnome.org/sources/gtk-doc/1.24/gtk-doc-1.24.tar.xz" 5 | sha256 "b420759ea05c760301bada14e428f1b321f5312f44e10a176d6804822dabb58b" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "gnome-doc-utils" => :build 9 | depends_on "itstool" => :build 10 | depends_on "gettext" 11 | depends_on "gnome/gitg/glib" 12 | depends_on "docbook" 13 | depends_on "docbook-xsl" 14 | depends_on "libxml2" => "with-python" 15 | 16 | def install 17 | ENV.append_path "PYTHONPATH", "#{Formula["libxml2"].opt_lib}/python2.7/site-packages" 18 | 19 | system "./configure", "--disable-debug", 20 | "--disable-dependency-tracking", 21 | "--prefix=#{prefix}", 22 | "--with-xml-catalog=#{etc}/xml/catalog" 23 | system "make" 24 | system "make", "install" 25 | end 26 | 27 | test do 28 | system "#{bin}/gtkdoc-scan", "--module=test" 29 | system "#{bin}/gtkdoc-mkdb", "--module=test" 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /osx/Taps/gitg/harfbuzz.rb: -------------------------------------------------------------------------------- 1 | class Harfbuzz < Formula 2 | desc "OpenType text shaping engine" 3 | homepage "https://wiki.freedesktop.org/www/Software/HarfBuzz/" 4 | url "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.2.7.tar.bz2" 5 | sha256 "bba0600ae08b84384e6d2d7175bea10b5fc246c4583dc841498d01894d479026" 6 | 7 | head do 8 | url "https://github.com/behdad/harfbuzz.git" 9 | 10 | depends_on "ragel" => :build 11 | depends_on "autoconf" => :build 12 | depends_on "automake" => :build 13 | depends_on "libtool" => :build 14 | end 15 | 16 | option "with-cairo", "Build command-line utilities that depend on Cairo" 17 | 18 | depends_on "pkg-config" => :build 19 | depends_on "gnome/gitg/glib" 20 | depends_on "freetype" 21 | depends_on "gnome/gitg/gobject-introspection" 22 | depends_on "icu4c" => :recommended 23 | depends_on "gnome/gitg/cairo" => :optional 24 | depends_on "graphite2" => :optional 25 | 26 | resource "ttf" do 27 | url "https://github.com/behdad/harfbuzz/raw/fc0daafab0336b847ac14682e581a8838f36a0bf/test/shaping/fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf" 28 | sha256 "9535d35dab9e002963eef56757c46881f6b3d3b27db24eefcc80929781856c77" 29 | end 30 | 31 | def install 32 | args = %W[ 33 | --disable-dependency-tracking 34 | --prefix=#{prefix} 35 | --enable-introspection=yes 36 | --with-gobject=yes 37 | --with-coretext=yes 38 | ] 39 | 40 | args << "--with-icu" if build.with? "icu4c" 41 | args << "--with-graphite2" if build.with? "graphite2" 42 | args << "--with-cairo" if build.with? "cairo" 43 | 44 | system "./autogen.sh" if build.head? 45 | system "./configure", *args 46 | system "make", "install" 47 | end 48 | 49 | test do 50 | resource("ttf").stage do 51 | shape = `echo 'സ്റ്റ്' | #{bin}/hb-shape 270b89df543a7e48e206a2d830c0e10e5265c630.ttf`.chomp 52 | assert_equal "[glyph201=0+1183|U0D4D=0+0]", shape 53 | end 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /osx/Taps/gitg/libcroco.rb: -------------------------------------------------------------------------------- 1 | class Libcroco < Formula 2 | desc "CSS parsing and manipulation toolkit for GNOME" 3 | homepage "http://www.linuxfromscratch.org/blfs/view/svn/general/libcroco.html" 4 | url "https://download.gnome.org/sources/libcroco/0.6/libcroco-0.6.11.tar.xz" 5 | sha256 "132b528a948586b0dfa05d7e9e059901bca5a3be675b6071a90a90b81ae5a056" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "intltool" => :build 9 | depends_on "gnome/gitg/glib" 10 | 11 | def install 12 | ENV.libxml2 13 | system "./configure", "--disable-dependency-tracking", 14 | "--prefix=#{prefix}", 15 | "--disable-Bsymbolic" 16 | system "make", "install" 17 | end 18 | 19 | test do 20 | (testpath/"test.css").write ".brew-pr { color: green }" 21 | assert_equal ".brew-pr {\n color : green\n}", 22 | shell_output("#{bin}/csslint-0.6 test.css").chomp 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /osx/Taps/gitg/libgee.rb: -------------------------------------------------------------------------------- 1 | class Libgee < Formula 2 | desc "Collection library providing GObject-based interfaces" 3 | homepage "https://wiki.gnome.org/Projects/Libgee" 4 | url "https://download.gnome.org/sources/libgee/0.18/libgee-0.18.0.tar.xz" 5 | sha256 "4ad99ef937d071b4883c061df40bfe233f7649d50c354cf81235f180b4244399" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "gnome/gitg/vala" => :build 9 | depends_on "gnome/gitg/gobject-introspection" 10 | 11 | def install 12 | # ensures that the gobject-introspection files remain within the keg 13 | inreplace "gee/Makefile.in" do |s| 14 | s.gsub! "@HAVE_INTROSPECTION_TRUE@girdir = @INTROSPECTION_GIRDIR@", 15 | "@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0" 16 | s.gsub! "@HAVE_INTROSPECTION_TRUE@typelibdir = @INTROSPECTION_TYPELIBDIR@", 17 | "@HAVE_INTROSPECTION_TRUE@typelibdir = $(libdir)/girepository-1.0" 18 | end 19 | 20 | system "./configure", "--prefix=#{prefix}", 21 | "--disable-dependency-tracking" 22 | system "make", "install" 23 | end 24 | 25 | test do 26 | (testpath/"test.c").write <<-EOS.undent 27 | #include 28 | 29 | int main(int argc, char *argv[]) { 30 | GType type = gee_traversable_stream_get_type(); 31 | return 0; 32 | } 33 | EOS 34 | gettext = Formula["gettext"] 35 | glib = Formula["glib"] 36 | flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split 37 | flags += %W[ 38 | -I#{gettext.opt_include} 39 | -I#{glib.opt_include}/glib-2.0 40 | -I#{glib.opt_lib}/glib-2.0/include 41 | -I#{include}/gee-0.8 42 | -L#{gettext.opt_lib} 43 | -L#{glib.opt_lib} 44 | -L#{lib} 45 | -lgee-0.8 46 | -lglib-2.0 47 | -lgobject-2.0 48 | -lintl 49 | ] 50 | system ENV.cc, "test.c", "-o", "test", *flags 51 | system "./test" 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /osx/Taps/gitg/libgit2-glib.rb: -------------------------------------------------------------------------------- 1 | class Libgit2Glib < Formula 2 | desc "Glib wrapper library around libgit2 git access library" 3 | homepage "https://github.com/GNOME/libgit2-glib" 4 | url "https://download.gnome.org/sources/libgit2-glib/0.24/libgit2-glib-0.24.0.tar.xz" 5 | sha256 "d616c268821c28ff8dc1a6419dbf8555fa48e31dc6509c10f5151be7690f4845" 6 | 7 | head do 8 | url "https://github.com/GNOME/libgit2-glib.git" 9 | 10 | depends_on "libtool" => :build 11 | depends_on "automake" => :build 12 | depends_on "autoconf" => :build 13 | depends_on "gnome-common" => :build 14 | depends_on "gnome/gitg/gtk-doc" => :build 15 | end 16 | 17 | depends_on "pkg-config" => :build 18 | depends_on "gettext" 19 | depends_on "gnome/gitg/libgit2" => "with-libssh2" 20 | depends_on "gnome/gitg/gobject-introspection" 21 | depends_on "gnome/gitg/glib" 22 | depends_on "gnome/gitg/vala" => :optional 23 | depends_on :python => :optional 24 | 25 | def install 26 | args = %W[ 27 | --prefix=#{prefix} 28 | --disable-silent-rules 29 | --disable-dependency-tracking 30 | ] 31 | 32 | args << "--enable-python=no" if build.without? "python" 33 | args << "--enable-vala=no" if build.without? "vala" 34 | 35 | system "./autogen.sh", *args if build.head? 36 | system "./configure", *args if build.stable? 37 | system "make", "install" 38 | 39 | libexec.install "examples/.libs", "examples/clone", "examples/general", "examples/walk" 40 | end 41 | 42 | test do 43 | mkdir "horatio" do 44 | system "git", "init" 45 | end 46 | system "#{libexec}/general", testpath/"horatio" 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /osx/Taps/gitg/libgit2.rb: -------------------------------------------------------------------------------- 1 | class Libgit2 < Formula 2 | desc "C library of Git core methods that is re-entrant and linkable" 3 | homepage "https://libgit2.github.com/" 4 | url "https://github.com/libgit2/libgit2/archive/v0.24.1.tar.gz" 5 | sha256 "60198cbb34066b9b5c1613d15c0479f6cd25f4aef42f7ec515cd1cc13a77fede" 6 | head "https://github.com/libgit2/libgit2.git" 7 | 8 | option :universal 9 | 10 | depends_on "pkg-config" => :build 11 | depends_on "cmake" => :build 12 | depends_on "libssh2" => :optional 13 | depends_on "openssl" if MacOS.version <= :lion # Uses SecureTransport on >10.7 14 | 15 | def install 16 | args = std_cmake_args 17 | args << "-DBUILD_EXAMPLES=YES" 18 | args << "-DBUILD_CLAR=NO" # Don't build tests. 19 | args << "-DUSE_SSH=NO" if build.without? "libssh2" 20 | 21 | if build.universal? 22 | ENV.universal_binary 23 | args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.universal_archs.as_cmake_arch_flags}" 24 | end 25 | 26 | mkdir "build" do 27 | system "cmake", "..", *args 28 | system "make", "install" 29 | cd "examples" do 30 | (pkgshare/"examples").install "add", "blame", "cat-file", "cgit2", 31 | "describe", "diff", "for-each-ref", 32 | "general", "init", "log", "remote", 33 | "rev-list", "rev-parse", "showindex", 34 | "status", "tag" 35 | end 36 | end 37 | end 38 | 39 | test do 40 | (testpath/"test.c").write <<-EOS.undent 41 | #include 42 | 43 | int main(int argc, char *argv[]) { 44 | int options = git_libgit2_features(); 45 | return 0; 46 | } 47 | EOS 48 | libssh2 = Formula["libssh2"] 49 | flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split 50 | flags += %W[ 51 | -I#{include} 52 | -I#{libssh2.opt_include} 53 | -L#{lib} 54 | -lgit2 55 | ] 56 | system ENV.cc, "test.c", "-o", "test", *flags 57 | system "./test" 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /osx/Taps/gitg/libgsf.rb: -------------------------------------------------------------------------------- 1 | class Libgsf < Formula 2 | desc "I/O abstraction library for dealing with structured file formats" 3 | homepage "https://developer.gnome.org/gsf/" 4 | url "https://download.gnome.org/sources/libgsf/1.14/libgsf-1.14.36.tar.xz" 5 | sha256 "71b7507f86c0f7c341bb362bdc7925a2ae286729be0bf5b8fd9581ffbbd62940" 6 | 7 | head do 8 | url "https://github.com/GNOME/libgsf.git" 9 | depends_on "automake" => :build 10 | depends_on "autoconf" => :build 11 | depends_on "gnome-common" => :build 12 | depends_on "gnome/gitg/gtk-doc" => :build 13 | depends_on "libtool" => :build 14 | end 15 | 16 | depends_on "pkg-config" => :build 17 | depends_on "intltool" => :build 18 | depends_on "gnome/gitggdk-pixbuf" => :optional 19 | depends_on "gettext" 20 | depends_on "gnome/gitgglib" 21 | 22 | def install 23 | args = %W[--disable-dependency-tracking --prefix=#{prefix}] 24 | if build.head? 25 | system "./autogen.sh", *args 26 | else 27 | system "./configure", *args 28 | end 29 | system "make", "install" 30 | end 31 | 32 | test do 33 | system bin/"gsf", "--help" 34 | (testpath/"test.c").write <<-EOS.undent 35 | #include 36 | int main() 37 | { 38 | void 39 | gsf_init (void); 40 | return 0; 41 | } 42 | EOS 43 | system ENV.cc, "-I#{include}/libgsf-1", 44 | "-I#{Formula["glib"].opt_include}/glib-2.0", 45 | "-I#{Formula["glib"].opt_lib}/glib-2.0/include", 46 | testpath/"test.c", "-o", testpath/"test" 47 | system "./test" 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /osx/Taps/gitg/libpeas.rb: -------------------------------------------------------------------------------- 1 | class Libpeas < Formula 2 | desc "GObject plugin library" 3 | homepage "https://developer.gnome.org/libpeas/stable/" 4 | url "https://download.gnome.org/sources/libpeas/1.18/libpeas-1.18.0.tar.xz" 5 | sha256 "bf49842c64c36925bbc41d954de490b6ff7faa29b45f6fd9e91ddcc779165e26" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "intltool" => :build 9 | depends_on "gettext" => :build 10 | depends_on "autoconf" => :build 11 | depends_on "automake" => :build 12 | depends_on "libtool" => :build 13 | depends_on "gnome-common" => :build 14 | depends_on "gnome/gitg/glib" 15 | depends_on "gnome/gitg/gobject-introspection" 16 | depends_on "gnome/gitg/gtk+3" 17 | 18 | def install 19 | system "autoreconf", "-i" 20 | system "./configure", "--disable-debug", 21 | "--disable-dependency-tracking", 22 | "--disable-silent-rules", 23 | "--prefix=#{prefix}", 24 | "--enable-gtk" 25 | system "make", "install" 26 | end 27 | 28 | test do 29 | (testpath/"test.c").write <<-EOS.undent 30 | #include 31 | 32 | int main(int argc, char *argv[]) { 33 | PeasObjectModule *mod = peas_object_module_new("test", "test", FALSE); 34 | return 0; 35 | } 36 | EOS 37 | gettext = Formula["gettext"] 38 | glib = Formula["glib"] 39 | gobject_introspection = Formula["gobject-introspection"] 40 | libffi = Formula["libffi"] 41 | flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split 42 | flags += %W[ 43 | -I#{gettext.opt_include} 44 | -I#{glib.opt_include}/glib-2.0 45 | -I#{glib.opt_lib}/glib-2.0/include 46 | -I#{gobject_introspection.opt_include}/gobject-introspection-1.0 47 | -I#{include}/libpeas-1.0 48 | -I#{libffi.opt_lib}/libffi-3.0.13/include 49 | -D_REENTRANT 50 | -L#{gettext.opt_lib} 51 | -L#{glib.opt_lib} 52 | -L#{gobject_introspection.opt_lib} 53 | -L#{lib} 54 | -lgio-2.0 55 | -lgirepository-1.0 56 | -lglib-2.0 57 | -lgmodule-2.0 58 | -lgobject-2.0 59 | -lintl 60 | -lpeas-1.0 61 | ] 62 | system ENV.cc, "test.c", "-o", "test", *flags 63 | system "./test" 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /osx/Taps/gitg/libsecret.rb: -------------------------------------------------------------------------------- 1 | class Libsecret < Formula 2 | desc "Library for storing/retrieving passwords and other secrets" 3 | homepage "https://wiki.gnome.org/Projects/Libsecret" 4 | url "https://download.gnome.org/sources/libsecret/0.18/libsecret-0.18.5.tar.xz" 5 | sha256 "9ce7bd8dd5831f2786c935d82638ac428fa085057cc6780aba0e39375887ccb3" 6 | 7 | depends_on "pkg-config" => :build 8 | depends_on "gnu-sed" => :build 9 | depends_on "intltool" => :build 10 | depends_on "gettext" => :build 11 | depends_on "gnome/gitg/vala" => :build 12 | depends_on "gnome/gitg/gobject-introspection" 13 | depends_on "gnome/gitg/glib" 14 | depends_on "libgcrypt" 15 | 16 | def install 17 | args = %W[ 18 | --disable-debug 19 | --disable-dependency-tracking 20 | --disable-silent-rules 21 | --prefix=#{prefix} 22 | ] 23 | 24 | args << "--enable-gobject-introspection" 25 | args << "--enable-vala" 26 | 27 | system "./configure", *args 28 | 29 | # https://bugzilla.gnome.org/show_bug.cgi?id=734630 30 | inreplace "Makefile", "sed", "gsed" 31 | 32 | # https://bugzilla.gnome.org/show_bug.cgi?id=734631 33 | inreplace "Makefile", "--nonet", "" 34 | system "make", "install" 35 | end 36 | 37 | test do 38 | (testpath/"test.c").write <<-EOS.undent 39 | #include 40 | 41 | const SecretSchema * example_get_schema (void) G_GNUC_CONST; 42 | 43 | const SecretSchema * 44 | example_get_schema (void) 45 | { 46 | static const SecretSchema the_schema = { 47 | "org.example.Password", SECRET_SCHEMA_NONE, 48 | { 49 | { "number", SECRET_SCHEMA_ATTRIBUTE_INTEGER }, 50 | { "string", SECRET_SCHEMA_ATTRIBUTE_STRING }, 51 | { "even", SECRET_SCHEMA_ATTRIBUTE_BOOLEAN }, 52 | { "NULL", 0 }, 53 | } 54 | }; 55 | return &the_schema; 56 | } 57 | 58 | int main() 59 | { 60 | example_get_schema(); 61 | } 62 | EOS 63 | 64 | flags = [ 65 | "-I#{include}/libsecret-1", 66 | "-I#{HOMEBREW_PREFIX}/include/glib-2.0", 67 | "-I#{HOMEBREW_PREFIX}/lib/glib-2.0/include" 68 | ] 69 | 70 | system ENV.cc, "test.c", "-o", "test", *flags 71 | system "./test" 72 | end 73 | end 74 | -------------------------------------------------------------------------------- /osx/Taps/gitg/shared-mime-info.rb: -------------------------------------------------------------------------------- 1 | class SharedMimeInfo < Formula 2 | desc "Database of common MIME types" 3 | homepage "https://wiki.freedesktop.org/www/Software/shared-mime-info" 4 | url "https://freedesktop.org/~hadess/shared-mime-info-1.6.tar.xz" 5 | sha256 "b2f8f85b6467933824180d0252bbcaee523f550a8fbc95cc4391bd43c03bc34c" 6 | 7 | head do 8 | url "https://anongit.freedesktop.org/git/xdg/shared-mime-info.git" 9 | depends_on "automake" => :build 10 | depends_on "autoconf" => :build 11 | depends_on "intltool" => :build 12 | end 13 | 14 | depends_on "pkg-config" => :build 15 | depends_on "intltool" => :build 16 | depends_on "gettext" 17 | depends_on "gnome/gitg/glib" 18 | 19 | def install 20 | # Disable the post-install update-mimedb due to crash 21 | args = %W[ 22 | --disable-dependency-tracking 23 | --prefix=#{prefix} 24 | --disable-update-mimedb 25 | ] 26 | if build.head? 27 | system "./autogen.sh", *args 28 | else 29 | system "./configure", *args 30 | end 31 | system "make", "install" 32 | end 33 | 34 | test do 35 | cp_r share/"mime", testpath 36 | system bin/"update-mime-database", testpath/"mime" 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /osx/Taps/gitg/vala.rb: -------------------------------------------------------------------------------- 1 | class Vala < Formula 2 | desc "Compiler for the GObject type system" 3 | homepage "https://live.gnome.org/Vala" 4 | url "https://download.gnome.org/sources/vala/0.32/vala-0.32.0.tar.xz" 5 | sha256 "07a2aa4ede040789b4b5af817a42249d703bfe8affccb7732ca2b53d00c1fb6e" 6 | 7 | depends_on "pkg-config" => :run 8 | depends_on "gettext" 9 | depends_on "gnome/gitg/glib" 10 | 11 | def install 12 | system "./configure", "--disable-dependency-tracking", 13 | "--disable-silent-rules", 14 | "--prefix=#{prefix}" 15 | system "make" # Fails to compile as a single step 16 | system "make", "install" 17 | end 18 | 19 | test do 20 | test_string = "Hello Homebrew\n" 21 | path = testpath/"hello.vala" 22 | path.write <<-EOS 23 | void main () { 24 | print ("#{test_string}"); 25 | } 26 | EOS 27 | valac_args = [ # Build with debugging symbols. 28 | "-g", 29 | # Use Homebrew's default C compiler. 30 | "--cc=#{ENV.cc}", 31 | # Save generated C source code. 32 | "--save-temps", 33 | # Vala source code path. 34 | path.to_s] 35 | system "#{bin}/valac", *valac_args 36 | assert File.exist?(testpath/"hello.c") 37 | 38 | assert_equal test_string, shell_output("#{testpath}/hello") 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /osx/data/Gitg-template.dmg.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg-template.dmg.xz -------------------------------------------------------------------------------- /osx/data/Gitg.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.icns -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_128x128.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_16x16.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_256x256.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_32x32.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_512x512.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_64x64.png -------------------------------------------------------------------------------- /osx/data/Gitg.iconset/icon_64x64@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/osx/data/Gitg.iconset/icon_64x64@2x.png -------------------------------------------------------------------------------- /osx/data/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | Gitg 9 | CFBundleGetInfoString 10 | ${version} Copyright 2015, ${name} 11 | CFBundleIconFile 12 | Gitg.icns 13 | CFBundleIdentifier 14 | org.gnome.Gitg 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | ${version} 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | ${version} 25 | NSHumanReadableCopyright 26 | Copyright 2015 ${name}, GNU General Public License. 27 | LSMinimumSystemVersion 28 | 10.7 29 | CFBundleName 30 | ${name} 31 | CFBundleDisplayName 32 | ${name} 33 | NSHighResolutionCapable 34 | True 35 | 36 | 37 | -------------------------------------------------------------------------------- /osx/scripts/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . $(dirname "$0")/env 4 | 5 | # Install brew if necessary 6 | if [ ! -f "$d/install/bin/brew" ]; then 7 | mkdir -p "$d/install" 8 | bsha1=375efe09455218d9929e41f16317074ccdf50f2a 9 | 10 | ( 11 | cd "$d/install" 12 | curl -L -o $bsha1.zip https://github.com/Homebrew/brew/archive/$bsha1.zip 13 | unzip $bsha1.zip 14 | rm -f $bsha1.zip 15 | 16 | shopt -s dotglob nullglob 17 | mv "brew-$bsha1"/* . 18 | shopt -u dotglob 19 | 20 | rmdir "brew-$bsha1" 21 | ) 22 | fi 23 | 24 | # Link tap if necessary 25 | tap="$d/install/Library/Taps/gnome/homebrew-gitg" 26 | 27 | if [ ! -d "$tap" ]; then 28 | mkdir -p "$d/install/Library/Taps/gnome" 29 | ln -s "$root/osx/Taps/gitg" "$tap" 30 | fi 31 | 32 | exec "$lbrew" install --dependencies-only --HEAD gnome/gitg/gitg 33 | -------------------------------------------------------------------------------- /osx/scripts/env: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | scripts=$(dirname "$0") 4 | 5 | pushd "$scripts/../../" > /dev/null 6 | root=$(pwd -P) 7 | popd > /dev/null 8 | 9 | suffix="3.20" 10 | 11 | d="/opt/build/gitg-$suffix" 12 | b="$d/install/bin/brew" 13 | 14 | lbrew="$root/osx/scripts/lbrew" 15 | 16 | export HOMEBREW_CACHE="$d/caches" 17 | 18 | export PATH="$d/install/bin:$PATH" 19 | export DYLD_FALLBACK_LIBRARY_PATH="/usr/lib" 20 | -------------------------------------------------------------------------------- /osx/scripts/launcher: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if test "x$GTK_DEBUG_LAUNCHER" != x; then 4 | set -x 5 | fi 6 | 7 | if test "x$GTK_DEBUG_GDB" != x; then 8 | EXEC="lldb --" 9 | elif test "x$GTK_DEBUG_DTRUSS" != x; then 10 | EXEC="dtruss" 11 | else 12 | EXEC=exec 13 | fi 14 | 15 | name=$(basename "$0") 16 | dirn=$(dirname "$0") 17 | 18 | pushd "$dirn/../../" > /dev/null 19 | bundle=$(pwd -P) 20 | popd > /dev/null 21 | 22 | bundle_contents="$bundle"/Contents 23 | bundle_res="$bundle_contents"/Resources 24 | bundle_lib="$bundle_res"/lib 25 | bundle_bin="$bundle_res"/bin 26 | bundle_data="$bundle_res"/share 27 | bundle_etc="$bundle_res"/etc 28 | 29 | export PATH="$bundle_bin:$PATH" 30 | export DYLD_LIBRARY_PATH="$bundle_lib:$DYLD_LIBRARY_PATH" 31 | export XDG_CONFIG_DIRS="$bundle_etc:$XDG_CONFIG_DIRS" 32 | export XDG_DATA_DIRS="$bundle_data:$XDG_DATA_DIRS" 33 | export GTK_DATA_PREFIX="$bundle_res" 34 | export GTK_EXE_PREFIX="$bundle_res" 35 | export GTK_PATH="$bundle_res" 36 | export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" 37 | export GIO_MODULE_DIR="$bundle_lib/gio/modules" 38 | export GI_TYPELIB_PATH="$bundle_lib/girepository-1.0" 39 | export PANGO_LIBDIR="$bundle_lib" 40 | export PANGO_SYSCONFDIR="$bundle_etc" 41 | export PEAS_PLUGIN_LOADERS_DIR="$bundle_lib/libpeas-1.0/loaders" 42 | export ENCHANT_MODULES_DIR="$bundle_lib/enchant" 43 | export ENCHANT_DATA_DIR="$bundle_data/enchant" 44 | 45 | if test -f "$bundle_lib/charset.alias"; then 46 | export CHARSETALIASDIR="$bundle_lib" 47 | fi 48 | 49 | # Extra arguments can be added in environment.sh. 50 | EXTRA_ARGS= 51 | 52 | if test -f "$bundle_res/environment.sh"; then 53 | source "$bundle_res/environment.sh" 54 | fi 55 | 56 | # Strip out the argument added by the OS. 57 | if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then 58 | shift 1 59 | fi 60 | 61 | if [ "x$GTK_DEBUG_SHELL" != "x" ]; then 62 | exec bash 63 | else 64 | $EXEC "$bundle_contents/MacOS/${name}-bin" "$@" $EXTRA_ARGS 65 | fi 66 | -------------------------------------------------------------------------------- /osx/scripts/lbrew: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . $(dirname "$0")/env 4 | 5 | exec "$b" "$@" 6 | -------------------------------------------------------------------------------- /osx/scripts/make-dmg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd $(dirname "$0")/.. > /dev/null 4 | D=$(pwd -P) 5 | popd > /dev/null 6 | 7 | ME="$0" 8 | BUNDLE_NAME="Gitg" 9 | BUNDLE="$D/$BUNDLE_NAME.app" 10 | 11 | # Copied and modified from gedit 12 | if [ ! -d "$BUNDLE" ]; then 13 | echo "Bundle $BUNDLE_NAME.app could not befound" 14 | exit 1 15 | fi 16 | 17 | VOLUME_NAME="$BUNDLE_NAME" 18 | 19 | if [ ! -z "$1" ]; then 20 | DMG_FILE="$1.dmg" 21 | else 22 | DMG_FILE="$D/$BUNDLE_NAME.dmg" 23 | fi 24 | 25 | DMG_APP="$BUNDLE" 26 | TMP_MOUNT_POINT="$TMPDIR/$VOLUME_NAME.mounted" 27 | FINAL_MOUNT_POINT="/Volumes/$VOLUME_NAME" 28 | 29 | rm -f $DMG_FILE 30 | rm -f $DMG_FILE.master 31 | 32 | # Compute an approximated image size in MB, and bloat by 1% 33 | image_size=$(du -ck "$DMG_APP" | tail -n1 | cut -f1) 34 | image_size=$((($image_size * 11) / 10000)) 35 | 36 | echo "Creating disk image (${image_size}MB)..." 37 | 38 | TMPNAME="$TMPDIR/$(basename ${DMG_FILE%.dmg}_tmp.dmg)" 39 | rm -f "$TMPNAME" 40 | 41 | #hdiutil create -volname "$BUNDLE_NAME" -srcfolder "$DMG_APP" -ov -format UDZO "$TMPNAME" || exit 1 42 | #hdiutil create -volname "$BUNDLE_NAME" -srcfolder "$DMG_APP" -ov -format UDRW "$TMPNAME" || exit 1 43 | 44 | cp "$D/data/Gitg-template.dmg.xz" "$TMPNAME.xz" 45 | unxz "$TMPNAME.xz" 46 | 47 | hdiutil resize -size ${image_size}m "$TMPNAME" || exit 1 48 | 49 | echo "Attaching to disk image..." 50 | hdiutil attach "$TMPNAME" -readwrite -noautoopen -mountpoint "$TMP_MOUNT_POINT" -quiet || exit 1 51 | 52 | echo "Populating image..." 53 | rsync -az "$DMG_APP" "$TMP_MOUNT_POINT/" || exit 1 54 | 55 | echo "Ensuring permissions" 56 | chmod -Rf go-w "$TMP_MOUNT_POINT" 2>/dev/null 57 | 58 | echo "Blessing image..." 59 | bless --folder "$TMP_MOUNT_POINT" --openfolder "$TMP_MOUNT_POINT" || exit 1 60 | 61 | echo "Detaching from disk image..." 62 | hdiutil detach "$TMP_MOUNT_POINT" -quiet || exit 1 63 | 64 | echo "Converting to final image..." 65 | hdiutil convert -quiet -format UDBZ -o "$DMG_FILE" "$TMPNAME" || exit 1 66 | 67 | # Make internet-enable 68 | hdiutil internet-enable -yes "$DMG_FILE" || exit 1 69 | 70 | rm -f "$TMPNAME" 71 | 72 | n=$(basename "$DMG_FILE") 73 | echo "Done $n." 74 | -------------------------------------------------------------------------------- /osx/scripts/shell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . $(dirname "$0")/env 4 | 5 | export GITG_SHELL=1 6 | 7 | dependencies="$($b deps gnome/gitg/gitg)" 8 | 9 | CFLAGS="-Wno-format-nonliteral -Wno-format-security" 10 | LDFLAGS="" 11 | 12 | prefix=$($b --prefix) 13 | 14 | PATH="$prefix/bin:$PATH" 15 | XDG_DATA_DIRS="$prefix/share:$XDG_DATA_DIRS" 16 | 17 | prefixes=$($b --prefix $dependencies) 18 | 19 | for prefix in $prefixes; 20 | do 21 | PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$PKG_CONFIG_PATH" 22 | XDG_DATA_DIRS="$prefix/share:$XDG_DATA_DIRS" 23 | 24 | CFLAGS="-I$prefix/include $CFLAGS" 25 | LDFLAGS="-L$prefix/lib $LDFLAGS" 26 | PATH="$prefix/bin:$PATH" 27 | done 28 | 29 | export PKG_CONFIG_PATH XDG_DATA_DIRS CFLAGS LDFLAGS PATH 30 | export PS1_EXTRA="\[\033[0;35m\](gitg)\[\033[0m\] " 31 | export MAKEFLAGS="-j$(sysctl -n machdep.cpu.core_count)" 32 | 33 | exec bash 34 | -------------------------------------------------------------------------------- /plugins/diff/diff.plugin: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Loader=C 3 | Module=diff 4 | Name=Diff 5 | Description=gitg repository diff 6 | Authors=Jesse van den Kieboom 7 | Copyright=Copyright © 2012 Jesse van den Kieboom 8 | Website= 9 | Hidden=1 10 | Builtin=1 11 | Version=1.0 12 | -------------------------------------------------------------------------------- /plugins/diff/icons/diff-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /plugins/diff/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | 'icons/diff-symbolic.svg', 3 | install_dir: join_paths(gitg_pkgdatadir, 'icons', 'hicolor', 'scalable', 'actions'), 4 | ) 5 | 6 | install_data( 7 | 'diff.plugin', 8 | install_dir: plugin_dir, 9 | ) 10 | 11 | sources = files('gitg-diff.vala') 12 | 13 | libdiff = shared_module( 14 | 'diff', 15 | sources: sources, 16 | include_directories: top_inc, 17 | dependencies: plugin_deps, 18 | c_args: plugin_cflags, 19 | install: true, 20 | install_dir: plugin_dir, 21 | name_suffix: module_suffix, 22 | ) 23 | -------------------------------------------------------------------------------- /plugins/diff/resources/resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /plugins/files/files.plugin: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Loader=C 3 | Module=files 4 | Name=Files 5 | Description=gitg repository files 6 | Authors=Jesse van den Kieboom 7 | Copyright=Copyright © 2012 Jesse van den Kieboom 8 | Website= 9 | Hidden=1 10 | Builtin=1 11 | Version=1.0 12 | -------------------------------------------------------------------------------- /plugins/files/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | 'files.plugin', 3 | install_dir: plugin_dir, 4 | ) 5 | 6 | sources = files( 7 | 'gitg-files.vala', 8 | 'gitg-files-tree-store.vala', 9 | ) 10 | 11 | resource_data = files('resources/view-files.ui') 12 | 13 | sources += gnome.compile_resources( 14 | 'gitg-files-resources', 15 | 'resources/resources.xml', 16 | source_dir: 'resources', 17 | dependencies: resource_data, 18 | ) 19 | 20 | libfiles = shared_module( 21 | 'files', 22 | sources: sources, 23 | include_directories: top_inc, 24 | dependencies: plugin_deps, 25 | c_args: plugin_cflags, 26 | install: true, 27 | install_dir: plugin_dir, 28 | name_suffix: module_suffix, 29 | ) 30 | -------------------------------------------------------------------------------- /plugins/files/resources/resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | view-files.ui 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plugins/meson.build: -------------------------------------------------------------------------------- 1 | plugin_cflags = warn_flags + [ 2 | '-DDATADIR="@0@"'.format(gitg_datadir), 3 | '-DLIBDIR="@0@"'.format(gitg_libdir), 4 | ] 5 | 6 | plugin_deps = [ 7 | config_dep, 8 | gee_dep, 9 | libgit2_glib_dep, 10 | gtk_dep, 11 | gtksourceview_dep, 12 | libgitg_dep, 13 | libgitg_ext_dep, 14 | libpeas_dep, 15 | ] 16 | 17 | plugin_dir = join_paths(gitg_pkglibdir, 'plugins') 18 | 19 | subdir('diff') 20 | subdir('files') 21 | -------------------------------------------------------------------------------- /po/ChangeLog: -------------------------------------------------------------------------------- 1 | 2009-04-22 Daniel Nylander 2 | 3 | * sv.po: Added Swedish translation 4 | * LINGUAS: Added sv 5 | 6 | 2009-03-01 Jesse van den Kieboom 7 | 8 | * nl.po: Updated Dutch translations (by Jesse van den Kieboom) 9 | 10 | 2009-02-28 Ignacio Casal Quinteiro 11 | 12 | * gl.po: Added Galician Translation. 13 | * LINGUAS: Added 'gl'. 14 | 15 | 2009-02-14 Jesse van den Kieboom 16 | * nl.po: updated translations 17 | 18 | 2009-02-08 Guilhem Bonnefille 19 | * fr.po: added 20 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # gitg translations 2 | # 3 | # please keep this list sorted alphabetically 4 | # 5 | ab 6 | as 7 | bg 8 | bs 9 | ca 10 | ca@valencia 11 | cs 12 | da 13 | de 14 | el 15 | en_GB 16 | eo 17 | es 18 | eu 19 | fi 20 | fr 21 | fur 22 | gl 23 | he 24 | hi 25 | hr 26 | hu 27 | id 28 | ie 29 | it 30 | ja 31 | ka 32 | kk 33 | ko 34 | lt 35 | lv 36 | ml 37 | ms 38 | nb 39 | ne 40 | nl 41 | oc 42 | pa 43 | pl 44 | pt 45 | pt_BR 46 | ro 47 | ru 48 | sk 49 | sl 50 | sr 51 | sr@latin 52 | sv 53 | tr 54 | uk 55 | vi 56 | zh_CN 57 | zh_HK 58 | zh_TW 59 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | # List of source files that should *not* be translated. 2 | # Please keep this file sorted alphabetically. 3 | gitg/commit/gitg-commit.c 4 | gitg/commit/gitg-commit-dialog.c 5 | gitg/gitg-action-support.c 6 | gitg/gitg-add-remote-action.c 7 | gitg/gitg-application.c 8 | gitg/gitg-author-details-dialog.c 9 | gitg/gitg.c 10 | gitg/gitg-clone-dialog.c 11 | gitg/gitg-commit-action-cherry-pick.c 12 | gitg/gitg-commit-action-create-branch.c 13 | gitg/gitg-commit-action-create-patch.c 14 | gitg/gitg-commit-action-create-tag.c 15 | gitg/gitg-create-tag-dialog.c 16 | gitg/gitg-dash-view.c 17 | gitg/gitg-edit-remote-action.c 18 | gitg/gitg-ref-action-checkout.c 19 | gitg/gitg-ref-action-copy-name.c 20 | gitg/gitg-ref-action-create-branch.c 21 | gitg/gitg-ref-action-create-patch.c 22 | gitg/gitg-ref-action-create-tag.c 23 | gitg/gitg-ref-action-delete.c 24 | gitg/gitg-ref-action-fetch.c 25 | gitg/gitg-ref-action-merge.c 26 | gitg/gitg-ref-action-push.c 27 | gitg/gitg-ref-action-rename.c 28 | gitg/gitg-ref-action-tag-info.c 29 | gitg/gitg-remote-notification.c 30 | gitg/gitg-remove-remote-action.c 31 | gitg/gitg-simple-notification.c 32 | gitg/gitg-window.c 33 | gitg/history/gitg-history.c 34 | gitg/history/gitg-history-command-line.c 35 | gitg/history/gitg-history-refs-list.c 36 | gitg/preferences/gitg-preferences-commit.c 37 | gitg/preferences/gitg-preferences-history.c 38 | gitg/preferences/gitg-preferences-interface.c 39 | libgitg/gitg-authentication-dialog.c 40 | libgitg/gitg-authentication-dialog.c 41 | libgitg/gitg-date.c 42 | libgitg/gitg-diff-image-side-by-side.c 43 | libgitg/gitg-diff-view.c 44 | libgitg/gitg-diff-view-commit-details.c 45 | libgitg/gitg-diff-view-file.c 46 | libgitg/gitg-repository-list-box.c 47 | libgitg/gitg-stage.c 48 | plugins/diff/gitg-diff.c 49 | plugins/files/gitg-files.c 50 | tests/gitg/gitg-action-support.c 51 | tests/gitg/gitg-commit-action-cherry-pick.c 52 | tests/gitg/gitg-ref-action-checkout.c 53 | tests/gitg/gitg-ref-action-merge.c 54 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(gitg_gettext, preset: 'glib') 2 | -------------------------------------------------------------------------------- /po/update-potfiles: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | top=$(git rev-parse --show-toplevel) 4 | allfiles=$(cd "$top" && git ls-files --no-empty-directory --exclude-standard | sort) 5 | 6 | echo "# List of source files containing translatable strings." 7 | echo "# This list has been automatically generated by update-potfiles." 8 | echo "[encoding: UTF-8]" 9 | 10 | # Desktop in files 11 | for i in $allfiles; 12 | do 13 | if [ ${i##*.} == "in" ] && grep -E '(^_|<_)' "$top/$i" &>/dev/null; then 14 | echo $i; 15 | fi 16 | done 17 | 18 | # vala source files 19 | for i in $allfiles; 20 | do 21 | if [ ${i##*.} == "vala" ] && grep -E '_\(["'"'"']' "$top/$i" &>/dev/null; then 22 | echo $i; 23 | fi 24 | done 25 | 26 | # gtkbuilder ui files 27 | for i in $allfiles; 28 | do 29 | if [ ${i##*.} == "ui" ] && grep -E 'translatable' "$top/$i" &>/dev/null; then 30 | echo "[type: gettext/glade]$i"; 31 | fi 32 | done 33 | -------------------------------------------------------------------------------- /tests/gitg/checkout-remote-branch-dialog-mock.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2020 - Armandas Jarušauskas 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | class CheckoutRemoteBranchDialog : Gtk.Dialog 24 | { 25 | public CheckoutRemoteBranchDialog(Gtk.Window? parent, Gitg.Repository? repository, Gitg.Ref reference) 26 | { 27 | } 28 | 29 | public string new_branch_name {get; set; default = "test_branch"; } 30 | 31 | public string remote_branch_name {get; set; default = "origin/test_branch"; } 32 | 33 | public bool track_remote {get; set; default = true; } 34 | 35 | public override void show() 36 | { 37 | } 38 | 39 | private bool entries_valid() 40 | { 41 | return (new_branch_name.length != 0) && (remote_branch_name.length != 0); 42 | } 43 | 44 | private void update_entries() 45 | { 46 | } 47 | } 48 | 49 | } 50 | 51 | // ex: ts=4 noet 52 | -------------------------------------------------------------------------------- /tests/gitg/main.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2013 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | class Gitg.Test.Runner 21 | { 22 | public static void main(string[] args) 23 | { 24 | var m = new Gitg.Test.Main(args); 25 | 26 | m.add(new CheckoutRef(), 27 | new MergeRef(), 28 | new CherryPickCommit()); 29 | 30 | m.run(); 31 | } 32 | } 33 | 34 | // ex:set ts=4 noet 35 | -------------------------------------------------------------------------------- /tests/gitg/meson.build: -------------------------------------------------------------------------------- 1 | sources = gitg_sources + support_sources + files( 2 | 'application-mock.vala', 3 | 'main.vala', 4 | 'notifications-mock.vala', 5 | 'ref-action-interface-mock.vala', 6 | 'simple-notification-mock.vala', 7 | 'checkout-remote-branch-dialog-mock.vala', 8 | 'test-checkout-ref.vala', 9 | 'test-cherry-pick-commit.vala', 10 | 'test-merge-ref.vala', 11 | ) 12 | 13 | deps = [ 14 | config_dep, 15 | gitg_assert_dep, 16 | libgitg_ext_dep, 17 | ] 18 | 19 | vala_flags = '--disable-warnings' 20 | 21 | test_unit = 'tests-gitg' 22 | 23 | exe = executable( 24 | test_unit, 25 | sources: sources, 26 | include_directories: top_inc, 27 | dependencies: deps, 28 | c_args: warn_flags, 29 | vala_args: vala_flags, 30 | ) 31 | 32 | test(test_unit, exe) 33 | -------------------------------------------------------------------------------- /tests/gitg/notifications-mock.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2015 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | using Gitg.Test.Assert; 21 | 22 | class Gitg.Test.Notifications : Object, GitgExt.Notifications 23 | { 24 | public signal void added(GitgExt.Notification notification); 25 | public signal void removed(GitgExt.Notification notification); 26 | 27 | public Gee.ArrayList notifications; 28 | 29 | public Notifications() 30 | { 31 | notifications = new Gee.ArrayList(); 32 | } 33 | 34 | public void add(GitgExt.Notification notification) 35 | { 36 | added(notification); 37 | notifications.add(notification); 38 | } 39 | 40 | public void remove(GitgExt.Notification notification, uint delay = 0) 41 | { 42 | removed(notification); 43 | notifications.remove(notification); 44 | } 45 | } 46 | 47 | // ex:set ts=4 noet 48 | -------------------------------------------------------------------------------- /tests/gitg/ref-action-interface-mock.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2015 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | using Gitg.Test.Assert; 21 | 22 | class Gitg.Test.RefActionInterface : Object, GitgExt.RefActionInterface 23 | { 24 | public GitgExt.Application application { owned get; construct set; } 25 | 26 | public RefActionInterface(GitgExt.Application application) 27 | { 28 | Object(application: application); 29 | } 30 | 31 | public Gee.List references 32 | { 33 | owned get { return new Gee.LinkedList(); } 34 | } 35 | 36 | public void add_ref(Gitg.Ref reference) 37 | { 38 | 39 | } 40 | 41 | public void remove_ref(Gitg.Ref reference) 42 | { 43 | 44 | } 45 | 46 | public void replace_ref(Gitg.Ref old_ref, Gitg.Ref new_ref) 47 | { 48 | 49 | } 50 | 51 | public void set_busy(Gitg.Ref reference, bool busy) 52 | { 53 | 54 | } 55 | 56 | public void edit_ref_name(Gitg.Ref reference, owned GitgExt.RefNameEditingDone callback) 57 | { 58 | 59 | } 60 | 61 | public void refresh() 62 | { 63 | 64 | } 65 | } 66 | 67 | // ex:set ts=4 noet 68 | -------------------------------------------------------------------------------- /tests/gitg/simple-notification-mock.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2012 - Ignacio Casal Quinteiro 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | namespace Gitg 21 | { 22 | 23 | public class SimpleNotification : Object, GitgExt.Notification 24 | { 25 | public enum Status 26 | { 27 | NONE, 28 | SUCCESS, 29 | ERROR 30 | } 31 | 32 | public signal void cancel(); 33 | public Status status { get; set; } 34 | 35 | public string title { get; set; } 36 | public string message { get; set; } 37 | 38 | public SimpleNotification(string? title = null, string? message = null) 39 | { 40 | Object(title: title, message: message); 41 | } 42 | 43 | public Gtk.Widget? widget 44 | { 45 | owned get { return null; } 46 | } 47 | 48 | public void success(string message) 49 | { 50 | this.message = message; 51 | this.status = Status.SUCCESS; 52 | } 53 | 54 | public void error(string message) 55 | { 56 | this.message = message; 57 | this.status = Status.ERROR; 58 | } 59 | } 60 | 61 | } 62 | 63 | // ex:ts=4 noet 64 | -------------------------------------------------------------------------------- /tests/libgitg/main.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2013 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | class LibGitg.Test.Main 21 | { 22 | public static void main(string[] args) 23 | { 24 | var m = new Gitg.Test.Main(args); 25 | 26 | m.add(new Stage(), 27 | new Date(), 28 | new Commit(), 29 | new Encoding()); 30 | 31 | m.run(); 32 | } 33 | } 34 | 35 | // ex:set ts=4 noet 36 | -------------------------------------------------------------------------------- /tests/libgitg/meson.build: -------------------------------------------------------------------------------- 1 | sources = support_sources + files( 2 | 'main.vala', 3 | 'test-commit.vala', 4 | 'test-date.vala', 5 | 'test-encoding.vala', 6 | 'test-stage.vala', 7 | ) 8 | 9 | deps = [ 10 | gitg_assert_dep, 11 | libgitg_dep, 12 | ] 13 | 14 | vala_flags = '--disable-warnings' 15 | 16 | test_unit = 'tests-libgitg' 17 | 18 | exe = executable( 19 | test_unit, 20 | sources: sources, 21 | include_directories: top_inc, 22 | dependencies: deps, 23 | c_args: warn_flags, 24 | vala_args: vala_flags, 25 | ) 26 | 27 | test(test_unit, exe) 28 | -------------------------------------------------------------------------------- /tests/libgitg/test-encoding.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2013 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | using Gitg.Test.Assert; 21 | 22 | class LibGitg.Test.Encoding : Gitg.Test.Repository 23 | { 24 | /** 25 | * Create basic repository with files in a variety of states. 26 | */ 27 | protected override void set_up() 28 | { 29 | base.set_up(); 30 | 31 | d_repository.get_config().set_string("i18n.commitencoding", "KOI8-R"); 32 | 33 | index_modify("b", "staged changes\n"); 34 | index_modify("a", "lala\n"); 35 | } 36 | 37 | /** 38 | * test commit. 39 | */ 40 | protected virtual signal void test_commit_encoding() 41 | { 42 | var stage = d_repository.stage; 43 | var loop = new MainLoop(); 44 | 45 | var sig = new Ggit.Signature.now("Jesse van den Kieboom", 46 | "jessevdk@gnome.org"); 47 | 48 | var msg = "This is the commit\n\nWith some cyЯЯilic.\n"; 49 | 50 | stage.commit.begin(msg, 51 | sig, 52 | sig, 53 | Gitg.StageCommitOptions.NONE, (obj, res) => { 54 | 55 | var oid = stage.commit.end(res); 56 | var commit = d_repository.lookup(oid); 57 | 58 | assert_streq(commit.get_message(), msg); 59 | 60 | loop.quit(); 61 | }); 62 | 63 | loop.run(); 64 | } 65 | } 66 | 67 | // ex:set ts=4 noet 68 | -------------------------------------------------------------------------------- /tests/meson.build: -------------------------------------------------------------------------------- 1 | subdir('support') 2 | subdir('libgitg') 3 | subdir('gitg') 4 | 5 | test_names = [ 6 | 'diff-view', 7 | 'repository-list-box', 8 | 'progress-bin', 9 | ] 10 | 11 | foreach test_name: test_names 12 | executable( 13 | 'tests-' + test_name, 14 | sources: test_name + '.vala', 15 | include_directories: top_inc, 16 | dependencies: libgitg_dep, 17 | c_args: warn_flags, 18 | ) 19 | endforeach 20 | -------------------------------------------------------------------------------- /tests/progress-bin.vala: -------------------------------------------------------------------------------- 1 | using Gtk; 2 | using Gitg; 3 | 4 | class TestProgressGrid 5 | { 6 | public static int main(string[] args) 7 | { 8 | Gtk.init(ref args); 9 | 10 | try 11 | { 12 | Gitg.init(); 13 | } 14 | catch (Error e) 15 | { 16 | stderr.printf("Failed to initialize ggit: %s\n", e.message); 17 | return 1; 18 | } 19 | 20 | var window = new Window(); 21 | window.set_default_size(300, 300); 22 | var grid = new ProgressBin(); 23 | grid.fraction = 0.3; 24 | window.add(grid); 25 | window.show_all(); 26 | 27 | window.delete_event.connect((w, ev) => { 28 | Gtk.main_quit(); 29 | return true; 30 | }); 31 | 32 | Gtk.main(); 33 | 34 | return 0; 35 | } 36 | } 37 | 38 | // vi:ts=4 39 | -------------------------------------------------------------------------------- /tests/repository-list-box.vala: -------------------------------------------------------------------------------- 1 | using Gtk; 2 | using Gitg; 3 | 4 | class TestRepositoryListBox 5 | { 6 | public static int main(string[] args) 7 | { 8 | Gtk.init(ref args); 9 | 10 | try 11 | { 12 | Gitg.init(); 13 | } 14 | catch (Error e) 15 | { 16 | stderr.printf("Failed to initialize ggit: %s\n", e.message); 17 | return 1; 18 | } 19 | 20 | var window = new Window(); 21 | window.set_default_size(300, 300); 22 | window.add(new RepositoryListBox()); 23 | window.show_all(); 24 | 25 | window.delete_event.connect((w, ev) => { 26 | Gtk.main_quit(); 27 | return true; 28 | }); 29 | 30 | Gtk.main(); 31 | 32 | return 0; 33 | } 34 | } 35 | 36 | // vi:ts=4 37 | -------------------------------------------------------------------------------- /tests/support/gitg-assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2013 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | #ifndef __GITG_ASSERT_H__ 21 | #define __GITG_ASSERT_H__ 22 | 23 | #include 24 | 25 | #define gitg_test_assert_assert_no_error(error) g_assert_no_error(error) 26 | #define gitg_test_assert_assert_streq(a, b) g_assert_cmpstr((a), ==, (b)) 27 | #define gitg_test_assert_assert_inteq(a, b) g_assert_cmpint((a), ==, (b)) 28 | #define gitg_test_assert_assert_booleq(a, b) g_assert_cmpuint((guint)(a), ==, (guint)(b)) 29 | #define gitg_test_assert_assert_uinteq(a, b) g_assert_cmpuint((a), ==, (b)) 30 | #define gitg_test_assert_assert_floateq(a, b) g_assert_cmpfloat((a), ==, (b)) 31 | #define gitg_test_assert_assert_datetime(a, b) \ 32 | g_assert_cmpstr (g_date_time_format ((a), "%F %T %z"), \ 33 | ==, \ 34 | g_date_time_format ((b), "%F %T %z") \ 35 | ) 36 | 37 | #endif /* __GITG_ASSERT_H__ */ 38 | 39 | -------------------------------------------------------------------------------- /tests/support/gitg-assert.vapi: -------------------------------------------------------------------------------- 1 | [CCode (cprefix = "Gitg", lower_case_prefix = "gitg_", cheader_filename = "gitg-assert.h")] 2 | namespace Gitg.Test.Assert 3 | { 4 | public static void assert_no_error(GLib.Error e); 5 | public static void assert_streq(string a, string b); 6 | public static void assert_inteq(int a, int b); 7 | public static void assert_booleq(bool a, bool b); 8 | public static void assert_uinteq(uint a, uint b); 9 | public static void assert_floateq(float a, float b); 10 | public static void assert_datetime(GLib.DateTime a, GLib.DateTime b); 11 | } 12 | -------------------------------------------------------------------------------- /tests/support/meson.build: -------------------------------------------------------------------------------- 1 | copygen = generator( 2 | find_program('cp'), 3 | arguments: ['@INPUT@', '@OUTPUT@'], 4 | output: 'support-@PLAINNAME@', 5 | ) 6 | 7 | sources = [ 8 | 'main.vala', 9 | 'repository.vala', 10 | 'test.vala', 11 | ] 12 | 13 | support_sources = [] 14 | 15 | foreach source: sources 16 | support_sources += copygen.process(source) 17 | endforeach 18 | 19 | gitg_assert_dep = declare_dependency( 20 | include_directories: include_directories('.'), 21 | dependencies: valac.find_library('gitg-assert', dirs: meson.current_source_dir()), 22 | ) 23 | -------------------------------------------------------------------------------- /tests/support/test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of gitg 3 | * 4 | * Copyright (C) 2013 - Jesse van den Kieboom 5 | * 6 | * gitg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * gitg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with gitg. If not, see . 18 | */ 19 | 20 | class Gitg.Test.Test : Object 21 | { 22 | private GLib.TestSuite d_suite; 23 | 24 | construct 25 | { 26 | d_suite = new GLib.TestSuite(get_type().name()); 27 | } 28 | 29 | public GLib.TestSuite suite 30 | { 31 | get { return d_suite; } 32 | } 33 | 34 | public virtual void set_up() 35 | { 36 | } 37 | 38 | public virtual void tear_down() 39 | { 40 | } 41 | } 42 | 43 | namespace Gitg.Test.Assert 44 | { 45 | void assert_file_contents(string filename, string expected_contents) 46 | { 47 | string contents; 48 | size_t len; 49 | 50 | try 51 | { 52 | FileUtils.get_contents(filename, out contents, out len); 53 | } 54 | catch (Error e) 55 | { 56 | assert_no_error(e); 57 | } 58 | 59 | assert_streq(contents, expected_contents); 60 | } 61 | } 62 | 63 | // ex:set ts=4 noet 64 | -------------------------------------------------------------------------------- /vapi/GDesktopEnums-3.0.metadata: -------------------------------------------------------------------------------- 1 | BackgroundShading cheader_filename="gdesktop-enums.h" 2 | BackgroundStyle cheader_filename="gdesktop-enums.h" 3 | ClockFormat cheader_filename="gdesktop-enums.h" 4 | FocusMode cheader_filename="gdesktop-enums.h" 5 | FocusNewWindows cheader_filename="gdesktop-enums.h" 6 | MagnifierCaretTrackingMode cheader_filename="gdesktop-enums.h" 7 | MagnifierFocusTrackingMode cheader_filename="gdesktop-enums.h" 8 | MagnifierMouseTrackingMode cheader_filename="gdesktop-enums.h" 9 | MagnifierScreenPosition cheader_filename="gdesktop-enums.h" 10 | MouseDwellDirection cheader_filename="gdesktop-enums.h" 11 | MouseDwellMode cheader_filename="gdesktop-enums.h" 12 | ProxyMode cheader_filename="gdesktop-enums.h" 13 | ScreensaverMode cheader_filename="gdesktop-enums.h" 14 | TitlebarAction cheader_filename="gdesktop-enums.h" 15 | ToolbarIconSize cheader_filename="gdesktop-enums.h" 16 | ToolbarStyle cheader_filename="gdesktop-enums.h" 17 | VisualBellType cheader_filename="gdesktop-enums.h" 18 | -------------------------------------------------------------------------------- /vapi/config.vapi: -------------------------------------------------------------------------------- 1 | [CCode(cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")] 2 | namespace Gitg.Config 3 | { 4 | public const string APPLICATION_ID; 5 | public const string PROFILE; 6 | public const string GETTEXT_PACKAGE; 7 | public const string PACKAGE_NAME; 8 | public const string PACKAGE_VERSION; 9 | public const string PACKAGE_URL; 10 | public const string GITG_DATADIR; 11 | public const string GITG_LOCALEDIR; 12 | public const string GITG_LIBDIR; 13 | public const string VERSION; 14 | public const string PLATFORM_NAME; 15 | } 16 | 17 | // ex:ts=4 noet 18 | -------------------------------------------------------------------------------- /vapi/gitg-platform-support.vapi: -------------------------------------------------------------------------------- 1 | namespace Gitg 2 | { 3 | [CCode(cprefix = "GitgPlatformSupport", lower_case_cprefix = "gitg_platform_support_", cheader_filename = "libgitg/gitg-platform-support.h")] 4 | public class PlatformSupport 5 | { 6 | public static bool use_native_window_controls(Gdk.Display? display = null); 7 | public static async GLib.InputStream http_get(GLib.File url, GLib.Cancellable? cancellable = null) throws GLib.IOError; 8 | 9 | public static Cairo.Surface create_cursor_surface(Gdk.Display? display, 10 | Gdk.CursorType cursor_type, 11 | out double hot_x = null, 12 | out double hot_y = null, 13 | out double width = null, 14 | out double height = null); 15 | 16 | public static GLib.InputStream new_input_stream_from_fd(int fd, bool close_fd); 17 | 18 | public static string get_lib_dir(); 19 | public static string get_locale_dir(); 20 | public static string get_data_dir(); 21 | public static string? get_user_home_dir(string? user = null); 22 | public static void application_support_prepare_startup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vapi/gobject-introspection-1.0.vapi: -------------------------------------------------------------------------------- 1 | [CCode (cprefix = "GI", lower_case_cprefix = "g_i", cheader_filename = "girepository.h")] 2 | namespace Introspection 3 | { 4 | [CCode (cprefix = "G_IREPOSITORY_ERROR_")] 5 | public errordomain RepositoryError { 6 | TYPELIB_NOT_FOUND, 7 | NAMESPACE_MISMATCH, 8 | NAMESPACE_VERSION_CONFLICT, 9 | LIBRARY_NOT_FOUND 10 | } 11 | 12 | [CCode (cname="int", cprefix = "G_IREPOSITORY_LOAD_FLAG_")] 13 | public enum RepositoryLoadFlags { 14 | LAZY = 1 15 | } 16 | 17 | [CCode (ref_function = "", unref_function = "")] 18 | public class Repository { 19 | public static unowned Repository get_default(); 20 | public static void prepend_search_path(string directory); 21 | public static unowned GLib.SList get_search_path(); 22 | 23 | public unowned Typelib? require(string namespace_, string? version = null, RepositoryLoadFlags flags = 0) throws RepositoryError; 24 | } 25 | 26 | [Compact] 27 | [CCode (cname = "GTypelib", cprefix = "g_typelib_", free_function = "g_typelib_free")] 28 | public class Typelib { 29 | public unowned string get_namespace(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vapi/gpgme.deps: -------------------------------------------------------------------------------- 1 | gpg-error 2 | -------------------------------------------------------------------------------- /vapi/gspell-1.deps: -------------------------------------------------------------------------------- 1 | gtk+-3.0 2 | -------------------------------------------------------------------------------- /vapi/gtksourceview-4.deps: -------------------------------------------------------------------------------- 1 | atk 2 | gdk-3.0 3 | gdk-pixbuf-2.0 4 | gio-2.0 5 | gtk+-3.0 6 | pango 7 | cairo 8 | -------------------------------------------------------------------------------- /win32/.gitignore: -------------------------------------------------------------------------------- 1 | installer/ 2 | -------------------------------------------------------------------------------- /win32/README: -------------------------------------------------------------------------------- 1 | To create the installer you need to follow the next steps: 2 | - install the latest version of msys2: http://msys2.github.io/ 3 | - launch msys2_shell.bat and update it with pacman -Syu, you will need to 4 | relaunch msys2_shell.bat after updating it 5 | - install git: pacman -S git 6 | - clone gitg: git clone https://gitlab.gnome.org/GNOME/gitg.git 7 | - cd gitg/win32 8 | - edit make-installer and set the right version of gitg 9 | - ./make-installer.bat 10 | -------------------------------------------------------------------------------- /win32/installer/WixUIBannerBmp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/win32/installer/WixUIBannerBmp.bmp -------------------------------------------------------------------------------- /win32/installer/WixUIDialogBmp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/gitg/f7501bc827f1d4476336b0db0791335cf8a613c4/win32/installer/WixUIDialogBmp.bmp -------------------------------------------------------------------------------- /win32/installer/defines.wxi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /win32/make-installer-all: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./make-installer stage1 && ./make-installer stage2 4 | -------------------------------------------------------------------------------- /win32/make-installer.bat: -------------------------------------------------------------------------------- 1 | C:/msys64/usr/bin/bash.exe -c "./make-installer stage1" 2 | if errorlevel 1 ( 3 | exit /b %errorlevel% 4 | ) 5 | 6 | C:/msys64/usr/bin/bash.exe -c "./make-installer stage2" 7 | if errorlevel 1 ( 8 | exit /b %errorlevel% 9 | ) 10 | --------------------------------------------------------------------------------