Bug#721654: dgit: Support `dgit version`

2013-09-11 Thread Ian Jackson
Richard, thanks for your contributions.  Just for the avoidance of any
doubt, and since you didn't include a signed-off-by in your commits,
can you confirm that:
 * You own the copyright in these submissions
 * You intend for these to be distributed along with the rest of dgit
   under dgit's existing licence (GPLv3 or later)
 * Your employer(s) don't have any rights which would conflict with this

Thanks,
Ian.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-11 Thread Richard Hartmann
Ian,

your changes make sense; thanks for improving on my hamfisted first attempt.

As requested:

* I do own the copyright to everything I submitted
* I am fine with GPLv2+ (as it's using Git and Git is GPLv2) so GPLv3+
is fine as well
* I did this in my own free time

Do you need anything else? Going forward, I will use Signed-Off-By.


Thanks,
Richard


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-11 Thread Ian Jackson
Richard Hartmann writes (Re: Bug#721654: dgit: Support `dgit version`):
 your changes make sense; thanks for improving on my hamfisted first attempt.
 
 As requested:
 
 * I do own the copyright to everything I submitted
 * I am fine with GPLv2+ (as it's using Git and Git is GPLv2) so GPLv3+
 is fine as well
 * I did this in my own free time

Thanks.

 Do you need anything else? Going forward, I will use Signed-Off-By.

No, that's fine.  Thank you.

Regards,
Ian.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-05 Thread Ian Jackson
Raphael Hertzog writes (Re: Bug#721654: dgit: Support `dgit version`):
 On Wed, 04 Sep 2013, Ian Jackson wrote:
  Why can't I ?  It's in the package.
 
 Because many people do not install files from /usr/share/doc to save space
 (with dpkg --path-exclude or tools doing something similar), because some
 derivatives (Emdebian) do this by default, etc.

This is a very good point.  Sorry for being dense.

I will think of a way of providing this that won't annoy me too much.
Richard, can you wait ?

Thanks,
Ian.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-05 Thread Richard Hartmann
On Thu, Sep 5, 2013 at 7:25 PM, Ian Jackson
ijack...@chiark.greenend.org.uk wrote:

 I will think of a way of providing this that won't annoy me too much.
 Richard, can you wait ?

Sure, no worries.


-- 
Richard


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-04 Thread Raphael Hertzog
On Wed, 04 Sep 2013, Richard Hartmann wrote:
  Perhaps dgit version should get the information from the first line
  of /usr/share/doc/dgit/changelog.gz.
 
 If you don't mind dgit depending on IO::Uncompress::Gunzip just for
 that (and IO::Uncompress::Xz at some point), I will submit such a
 patch.

Sorry, this is plain stupid. You can't rely on the availability of the
changelog file.

If you want to avoid the duplication, put a placeholder in the source file
and replace it at build time.

our $version = @VERSION@;

and then sed -i -e s/@VERSION@/$VERSION/
(with VERSION=$(dpkg-parsechangelog -SVersion))

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-04 Thread Ian Jackson
Raphael Hertzog writes (Re: Bug#721654: dgit: Support `dgit version`):
 On Wed, 04 Sep 2013, Richard Hartmann wrote:
  If you don't mind dgit depending on IO::Uncompress::Gunzip just for
  that (and IO::Uncompress::Xz at some point), I will submit such a
  patch.
 
 Sorry, this is plain stupid. You can't rely on the availability of the
 changelog file.

Why can't I ?  It's in the package.

 If you want to avoid the duplication, put a placeholder in the source file
 and replace it at build time.
 
 our $version = @VERSION@;
 
 and then sed -i -e s/@VERSION@/$VERSION/
 (with VERSION=$(dpkg-parsechangelog -SVersion))

This is quite annoying.

Ian.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-04 Thread Ian Jackson
Richard Hartmann writes (Bug#721654: dgit: Support `dgit version`):
 If you don't mind dgit depending on IO::Uncompress::Gunzip just for
 that (and IO::Uncompress::Xz at some point), I will submit such a
 patch.

Why not use zcat instead ?

Ian.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-04 Thread Raphael Hertzog
Hi,

On Wed, 04 Sep 2013, Ian Jackson wrote:
 Why can't I ?  It's in the package.

Because many people do not install files from /usr/share/doc to save space
(with dpkg --path-exclude or tools doing something similar), because some
derivatives (Emdebian) do this by default, etc.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-04 Thread Richard Hartmann
On Wed, Sep 4, 2013 at 9:11 PM, Raphael Hertzog hert...@debian.org wrote:

 Because many people do not install files from /usr/share/doc to save space
 (with dpkg --path-exclude or tools doing something similar), because some
 derivatives (Emdebian) do this by default, etc.

Or maybe they run from a checkout. If a script relies on a minimum
version, that will then break.

The more I think about it, the more I like the initial patch. Yes,
it's more work during release time, but it's also the most reliable
solution. And realistically speaking, people rely on version
information and don't want to query dpkg or similar hacks..

A pre-commit hook to check if changelog and internal version agree
could be an option to verify that no mistakes happen. Would you be
willing to accept something like that?


Richard


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-03 Thread Ian Jackson
tags 721654 - patch
thanks

Richard Hartmann writes (Bug#721654: dgit: Support `dgit version`):
 From: Richard Hartmann ric...@debian.org
 Date: Mon, 2 Sep 2013 21:04:41 +0200
 Subject: [PATCH] dgit*: Implement `dgit version`

Thanks, but I'm not sure how valuable this is.  If people think it
would be helpful I don't mind it existing, but:

 +our $dgit_version = 0.14;
 +

I don't want to duplicate the version number, because that would
complicate the release process.  And I'd rather avoid editing the dgit
script as it is installed, unless absolutely necessary.

Perhaps dgit version should get the information from the first line
of /usr/share/doc/dgit/changelog.gz.

Thanks,
Ian.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-03 Thread Richard Hartmann
On Tue, Sep 3, 2013 at 2:46 PM, Ian Jackson
ijack...@chiark.greenend.org.uk wrote:

 Thanks, but I'm not sure how valuable this is.  If people think it
 would be helpful I don't mind it existing, but:

Well, it's one of the most common functions of any program. Myself, I
realized it was missing after I ran a dist-upgrade and still had the
error with missing .git/dgit (0.14 hadn't reached my mirror yet).


 +our $dgit_version = 0.14;
 +

 I don't want to duplicate the version number, because that would
 complicate the release process.  And I'd rather avoid editing the dgit
 script as it is installed, unless absolutely necessary.

I agree that build or install time changes are icky. Release time, not
so much, but OK.


 Perhaps dgit version should get the information from the first line
 of /usr/share/doc/dgit/changelog.gz.

If you don't mind dgit depending on IO::Uncompress::Gunzip just for
that (and IO::Uncompress::Xz at some point), I will submit such a
patch.


Richard


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#721654: dgit: Support `dgit version`

2013-09-02 Thread Richard Hartmann
Package: dgit
Version: 0.13
Severity: minor
Tags: patch

Please see attached.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dgit depends on:
ii  devscripts 2.13.3
ii  dpkg-dev   1.17.1
ii  git [git-core] 1:1.8.4~rc3-1
ii  libdpkg-perl   1.17.1
ii  libwww-perl6.05-1
ii  perl [libdigest-sha-perl]  5.14.2-21
ii  realpath   1.18

Versions of packages dgit recommends:
ii  openssh-client [ssh-client]  1:6.2p2-6

Versions of packages dgit suggests:
pn  sbuild  none

-- no debconf information
From 0ee5f5cf83367509622b38d0c5f57cb5b1445564 Mon Sep 17 00:00:00 2001
From: Richard Hartmann ric...@debian.org
Date: Mon, 2 Sep 2013 21:04:41 +0200
Subject: [PATCH] dgit*: Implement `dgit version`

---
 dgit   | 6 ++
 dgit.1 | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/dgit b/dgit
index 98fd04d..e11c6f2 100755
--- a/dgit
+++ b/dgit
@@ -28,6 +28,8 @@ use File::Basename;
 use Dpkg::Version;
 use POSIX;
 
+our $dgit_version = 0.14;
+
 our $isuite = 'unstable';
 our $idistro;
 our $package;
@@ -1199,6 +1201,10 @@ sub cmd_quilt_fixup {
 build_maybe_quilt_fixup();
 }
 
+sub cmd_version {
+	print dgit version $dgit_version\n;
+}
+
 sub parseopts () {
 my $om;
 while (@ARGV) {
diff --git a/dgit.1 b/dgit.1
index 5c5a55e..b185d5d 100644
--- a/dgit.1
+++ b/dgit.1
@@ -148,6 +148,9 @@ by making a new debian/ patch containing your unquilty changes) and
 make a commit of the changes it has made.
 
 This is normally done automatically by dgit build and dgit push.
+.TP
+.B dgit version
+Prints version information and exits.
 .SH OPTIONS
 .TP
 .BR --dry-run | -n
-- 
1.8.4.rc3