Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
env:
DESTDIR: out
run: |
git config --global --add safe.directory "$(pwd)"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git config --global --add safe.directory "$(pwd)"
git config --global --add safe.directory "$GITHUB_WORKSPACE"

It seems like we use this environment variable in other places. Also this is (slightly) more efficient than a command substitution.

meson build -Ddocumentation=true -Dtests=true
ninja -C build
ninja -C build install
Expand Down Expand Up @@ -78,6 +79,7 @@ jobs:
env:
DESTDIR: out
run: |
git config --global --add safe.directory "$(pwd)"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git config --global --add safe.directory "$(pwd)"
git config --global --add safe.directory "$GITHUB_WORKSPACE"

Same here.

meson build
ninja -C build install

Expand Down
3 changes: 2 additions & 1 deletion config.vala.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io)
* SPDX-FileCopyrightText: 2025-2026 elementary, Inc. (https://elementary.io)
* 2011 Robert Dyer
* 2011 Rico Tzschichholz
*/
Expand All @@ -10,4 +10,5 @@ namespace Config {
public const string LOCALEDIR = "@LOCALEDIR@";
public const string VERSION = "@VERSION@";
public const string PLUGINDIR = "@PLUGINDIR@";
public const string GIT_HASH = "@GIT_HASH@";
}
8 changes: 8 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ conf.set('GETTEXT_PACKAGE', meson.project_name())
conf.set('LOCALEDIR', locale_dir)
conf.set('PLUGINDIR', plugins_dir)
conf.set('VERSION', meson.project_version())

git = find_program('git', required: false)
git_hash = 'unknown'
if git.found()
git_hash = run_command(['git', 'rev-parse', '--short', 'HEAD'], capture : true, check : true).stdout().strip()
endif
conf.set('GIT_HASH', git_hash)

config_header = configure_file (
input: 'config.vala.in',
output: 'config.vala',
Expand Down
3 changes: 2 additions & 1 deletion src/Main.vala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// Copyright (C) 2012 Tom Beckmann, Rico Tzschichholz
// Copyright (C) 2026 elementary, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand All @@ -22,7 +23,7 @@ namespace Gala {
};

private void print_version () {
stdout.printf ("Gala %s\n", Config.VERSION);
stdout.printf ("Gala %s (%s)\n", Config.VERSION, Config.GIT_HASH);
Meta.exit (Meta.ExitCode.SUCCESS);
}

Expand Down