bugGnash - The GNU Flash player - Bugs: bug #50462, Gnash shows weird version...

 
 

bug #50462: Gnash shows weird version information when built from detached-HEAD Git repository

Submitted by:  Nutchanon Wetchasit <nachanon>
Submitted on:  Sun 05 Mar 2017 03:59:04 PM UTC  
 
Category: buildSeverity: 3 - Normal
Release: masterStatus: Fixed
Privacy: PublicAssigned to: Sandro Santilli <strk>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 08 Mar 2017 10:08:40 AM UTC, comment #10:

Pushed as 2383a5618a88db2c94c3b593a12ed020b8657bea

Sandro Santilli <strk>
Project MemberIn charge of this item.
Wed 08 Mar 2017 09:48:21 AM UTC, comment #9:

Build results of the fixed patch (file #39935) on my system are as follows...

On-tree build, 144e082 on `master` branch:

On-tree build, detached HEAD at 144e082:

Off-tree build, 144e082 on `master` branch:

Off-tree build, detached HEAD at 144e082:

You would see that the version displays are now showing expected branch nickname in both normal and detached-HEAD repository, and in both on-tree and off-tree build configuration.

Gnash: 0.8.11dev (patched against git 144e082 22-Feb-2017)
Git: 1:1.7.10.4-1+wheezy1 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Wed 08 Mar 2017 09:43:17 AM UTC, comment #8:

I have re-checked the patch with on-tree and off-tree building: the problem seems to caused by an error on my part, sorry. (It's a mix-up between Make's and Make's sub-shell variable)

From Makefile patched by original patch (file #39917):

It should have been...

As there's no Make variable named "nick", it causes branch nickname to always be assigned as "none"; no matter that Git HEAD is currently on a valid branch or not. On-tree V.S. off-tree building configuration is irrelevant in this case.

I have attached the corrected patch as `0001_use-git-symbolicref-for-revno-branch-v2.patch`.

Gnash: 0.8.11dev (patched against git 144e082 22-Feb-2017)
Git: 1:1.7.10.4-1+wheezy1 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

(file #39935)

Nutchanon Wetchasit <nachanon>
Tue 07 Mar 2017 01:38:47 PM UTC, comment #7:

Ok with "none" then, but I've tried your patch and I get "none" even when I'm on a valid branch. This is with Git 2.7.4 - note that both symbolic-ref -q HEAD and basename work fine when invoked manually, so there must be another issue (my build dir is outside the source dir, in case that matters)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Tue 07 Mar 2017 01:07:28 PM UTC, comment #6:

@strk,
In detached HEAD mode, `git branch --contains REVSHA1` does not seem to work like expected:

You would see that the highlighted branch name is still "(no branch)".

Gnash: 0.8.11dev (git 144e082 22-Feb-2017)
Git: 1:1.7.10.4-1+wheezy1 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Tue 07 Mar 2017 11:21:55 AM UTC, comment #5:

How about picking a branch containing the commit ?
In the example case you're making I see "master" branch
does contain 144e082:

```
git branch --contains 144e082
```

Sandro Santilli <strk>
Project MemberIn charge of this item.
Tue 07 Mar 2017 10:12:48 AM UTC, comment #4:

Patch included, see below.

These patches use a combination of `git symbolic-ref -q HEAD` and `basename` to determine current branch. All of them do the same thing, but use a different placeholder branch nickname when current branch cannot be determined; only one can be chosen for inclusion in mainline.

Choice 1. Use "none" when current branch cannot be determined:
0001_use-git-symbolicref-for-revno-branch.patch (file #39917)
(Screenshot of About Gnash dialog: file #39918)

Choice 2. Use "unknown" when current branch cannot be determined:
0001_use-git-symbolicref-for-revno-branch-unknown-placeholder.patch (file #39919)
(Screenshot of About Gnash dialog: file #39920)

Choice 3. Use pre-written version from configure.ac's `AC_INIT` when current branch cannot be determined:
0001_use-git-symbolicref-for-revno-branch-version-placeholder.patch (file #39921)
(Screenshot of About Gnash dialog: file #39922)

Portability notes:

  • A use of `basename` shouldn't be problem since `configure` is already using it.
  • `git symbolic-ref -q HEAD` works in expected manner at least in Git 1.5.6.5, 1.7.10.4, and 2.11.1.

Gnash: 0.8.11dev (patched against git 144e082 22-Feb-2017)
Git: 1:1.7.10.4-1+wheezy1 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Sun 05 Mar 2017 05:24:08 PM UTC, comment #3:

And another question is: what branch nickname should be displayed when the repository HEAD is not on any branch?

One possible choice is using "none"...

Or use "unknown"...

Or use a pre-written `$VERSION`...
(This is currently used when Gnash is built out of Git repository)

Or omit the branch part and its following dash entirely...
(This would require changing how version string is built when such case is encountered)

Gnash: 0.8.11dev (git 144e082 22-Feb-2017)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Sun 05 Mar 2017 04:34:23 PM UTC, comment #2:

Previous post's markup is messed up a bit, here is a repost:

This oddity seems to boil down to how Gnash build script extracts branch information from the repository...

Makefile.am:161:

Running `git branch` in the repository after `git checkout 144e082` shows:

Since what branch retrieval command did is finding line beginning with "*" and use its 2nd column (separated by space). So "(no branch)" became "(no" displayed in the version string:

If a more modern version of git (e.g. 2.11.1) is used, output would be even more weird:

Maybe a fix would involve changing the source of branch information from porcelain `git branch` (which is prone to format changes) to something low-level like `git symbolic-ref` (which is recommended for scripting).

Gnash: 0.8.11dev (git 144e082 22-Feb-2017)
Git: 1:1.7.10.4-1+wheezy1 (debian)
Git: 2.11.1 (source)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Sun 05 Mar 2017 04:30:58 PM UTC, comment #1:

This seems to boil down to how Gnash build script extracts branch information from the repository...

Makefile.am:161:

Running `git branch` in the repository after `git checkout 144e082` shows:

Since what branch retrieval command did is finding line beginning with "*" and use its 2nd column (separated by space). So "(no branch)" became "(no" displayed in the version string:

Nutchanon Wetchasit <nachanon>
Sun 05 Mar 2017 03:59:04 PM UTC, original submission:

This is a minor issue, but it would be nice if it get fixed.

While I was going back and forth in local Gnash Git repository, I ran into some oddity when I leave the repository in detatched HEAD mode (a la `git checkout REVSHA1`): I found that Gnash built from that repository would show a weird version string:

You would see that the branch part displayed in the version string is "(no", which is not normal; and this oddity also show up in GTK-Gnash's About dialog too (see the attached screenshot).

This problem does not seem to affect usability of the build, though it may cause confusion when user try to report bugs in Gnash built from that kind of repository configuration.

Gnash: 0.8.11dev (git 144e082 22-Feb-2017)
Git: 1:1.7.10.4-1+wheezy1 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #39935:  0001_use-git-symbolicref-for-revno-branch-v2.patch added by nachanon (1KiB - text/x-diff - A corrected patch to use "git symbolic-ref" for branch info, or "none" when fail)
file #39922:  aboutgnash_0.8.11dev-144e082_versionplaceholder.png added by nachanon (9KiB - image/png - About Gnash dialog (built with detatched HEAD) after applied `0001_use-git-symbolicref-for-revno-branch-version-placeholder.patch`)
file #39921:  0001_use-git-symbolicref-for-revno-branch-version-placeholder.patch added by nachanon (1KiB - application/octet-stream - Patch to use "git symbolic-ref" for branch info, or $VERSION when fail)
file #39920:  aboutgnash_0.8.11dev-144e082_unknownplaceholder.png added by nachanon (9KiB - image/png - About Gnash dialog (built with detatched HEAD) after applied `0001_use-git-symbolicref-for-revno-branch-unknown-placeholder.patch`)
file #39919:  0001_use-git-symbolicref-for-revno-branch-unknown-placeholder.patch added by nachanon (1KiB - application/octet-stream - Patch to use "git symbolic-ref" for branch info, or "unknown" when fail)
file #39918:  aboutgnash_0.8.11dev-144e082_noneplaceholder.png added by nachanon (8KiB - image/png - About Gnash dialog (built with detatched HEAD) after applied `0001_use-git-symbolicref-for-revno-branch.patch`)
file #39917:  0001_use-git-symbolicref-for-revno-branch.patch added by nachanon (1KiB - application/octet-stream - Patch to use "git symbolic-ref" for branch info, or "none" when fail)
file #39895:  aboutgnash_0.8.11dev-144e082.png added by nachanon (8KiB - image/png - About Gnash dialog from Gnash 0.8.11dev git 144e082, built in detatched-HEAD mode)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by nachanon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 08 Mar 2017 10:08:40 AM UTCstrkStatusNone=>Fixed
      Assigned toNone=>strk
      Open/ClosedOpen=>Closed
    Wed 08 Mar 2017 09:43:17 AM UTCnachanonAttached File-=>Added 0001_use-git-symbolicref-for-revno-branch-v2.patch, #39935
    Tue 07 Mar 2017 10:07:37 AM UTCnachanonAttached File-=>Added aboutgnash_0.8.11dev-144e082_versionplaceholder.png, #39922
    Tue 07 Mar 2017 10:06:22 AM UTCnachanonAttached File-=>Added 0001_use-git-symbolicref-for-revno-branch-version-placeholder.patch, #39921
    Tue 07 Mar 2017 10:04:32 AM UTCnachanonAttached File-=>Added aboutgnash_0.8.11dev-144e082_unknownplaceholder.png, #39920
    Tue 07 Mar 2017 10:03:24 AM UTCnachanonAttached File-=>Added 0001_use-git-symbolicref-for-revno-branch-unknown-placeholder.patch, #39919
    Tue 07 Mar 2017 10:01:17 AM UTCnachanonAttached File-=>Added aboutgnash_0.8.11dev-144e082_noneplaceholder.png, #39918
    Tue 07 Mar 2017 09:58:16 AM UTCnachanonAttached File-=>Added 0001_use-git-symbolicref-for-revno-branch.patch, #39917
    Sun 05 Mar 2017 03:59:04 PM UTCnachanonAttached File-=>Added aboutgnash_0.8.11dev-144e082.png, #39895

    Back to the top


    Powered by Savane 3.1-cleanup1