# [PATCH] Reorder msgfmt command-line arguments.

5 messages from 2007-12-03 to 2007-12-04. Participants: brian m. carlson, Johannes Schindelin, Shawn O. Pearce.
Thread: https://gitlist.dev/t/11105

## brian m. carlson, 2007-12-03 01:26

Subject: [PATCH] Reorder msgfmt command-line arguments.
Message-ID: <20071203012631.GA22450@crustytoothpaste.ath.cx>
URL: https://gitlist.dev/e/20071203012631.GA22450%40crustytoothpaste.ath.cx

```
Any program using getopt or getopt_long will stop processing options
once a non-option argument has been encountered, if POSIXLY_CORRECT is
set.  Therefore, reorder the command-line arguments to put options
first, so that the msgfmt call works in this scenario.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.ath.cx>
---

Note that this patch is against the next branch, since that's what I 
use.  It may or may not apply (or be needed) on the mainline.

  git-gui/Makefile |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-gui/Makefile b/git-gui/Makefile
index e860319..4ce4663 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -212,7 +212,7 @@ $(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
  update-po:: $(PO_TEMPLATE)
  	$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
  $(ALL_MSGFILES): %.msg : %.po
-	$(QUIET_MSGFMT0)$(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@) $(QUIET_MSGFMT1)
+	$(QUIET_MSGFMT0)$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $< $(QUIET_MSGFMT1)
  
  lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VARS
  	$(QUIET_INDEX)if echo \
-- 
1.5.3.6.1797.g67f5d

```

## Johannes Schindelin, 2007-12-03 10:35

Subject: Re: [PATCH] Reorder msgfmt command-line arguments.
Message-ID: <Pine.LNX.4.64.0712031034200.27959@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0712031034200.27959%40racer.site
In-Reply-To: <20071203012631.GA22450@crustytoothpaste.ath.cx>

```
Hi,

On Mon, 3 Dec 2007, brian m. carlson wrote:

> Any program using getopt or getopt_long will stop processing options 
> once a non-option argument has been encountered, if POSIXLY_CORRECT is 
> set.

So have you tested that msgfmt indeed does not work with the present 
command line?

Besides, you probably want to send this as a git-gui patch: based on 
git-gui.git, not git.git, and Cc'ed to Shawn Pearce.

Ciao,
Dscho

```

## brian m. carlson, 2007-12-03 17:04

Subject: Re: [PATCH] Reorder msgfmt command-line arguments.
Message-ID: <20071203170402.GA13712@crustytoothpaste.ath.cx>
URL: https://gitlist.dev/e/20071203170402.GA13712%40crustytoothpaste.ath.cx
In-Reply-To: <Pine.LNX.4.64.0712031034200.27959@racer.site>

```
On Mon, Dec 03, 2007 at 10:35:33AM +0000, Johannes Schindelin wrote:
>On Mon, 3 Dec 2007, brian m. carlson wrote:
>
>> Any program using getopt or getopt_long will stop processing options 
>> once a non-option argument has been encountered, if POSIXLY_CORRECT is 
>> set.
>
>So have you tested that msgfmt indeed does not work with the present 
>command line?

Yes.  I run with POSIXLY_CORRECT set to 1, and it does indeed break.  I 
wouldn't have fixed it if it had worked.

There are parts of the git testsuite that hang in this case, too, but I 
have yet to examine them.  Rest assured that there are indeed patches 
coming, assuming the problems are fixable.

>Besides, you probably want to send this as a git-gui patch: based on 
>git-gui.git, not git.git, and Cc'ed to Shawn Pearce.

Thanks.  Will do.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
a typesetting engine: http://crustytoothpaste.ath.cx/~bmc/code/thwack
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

```

## Johannes Schindelin, 2007-12-03 18:05

Subject: Re: [PATCH] Reorder msgfmt command-line arguments.
Message-ID: <Pine.LNX.4.64.0712031805310.27959@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0712031805310.27959%40racer.site
In-Reply-To: <20071203170402.GA13712@crustytoothpaste.ath.cx>

```
Hi,

On Mon, 3 Dec 2007, brian m. carlson wrote:

> On Mon, Dec 03, 2007 at 10:35:33AM +0000, Johannes Schindelin wrote:
> > On Mon, 3 Dec 2007, brian m. carlson wrote:
> > 
> > > Any program using getopt or getopt_long will stop processing options 
> > > once a non-option argument has been encountered, if POSIXLY_CORRECT 
> > > is set.
> > 
> > So have you tested that msgfmt indeed does not work with the present 
> > command line?
> 
> Yes.  I run with POSIXLY_CORRECT set to 1, and it does indeed break.  I 
> wouldn't have fixed it if it had worked.

Ah, so it is a not-so-common breakage.

Thanks for clarifying,
Dscho

```

## Shawn O. Pearce, 2007-12-04 02:07

Subject: Re: [PATCH] Reorder msgfmt command-line arguments.
Message-ID: <20071204020748.GZ14735@spearce.org>
URL: https://gitlist.dev/e/20071204020748.GZ14735%40spearce.org
In-Reply-To: <20071203170402.GA13712@crustytoothpaste.ath.cx>

```
"brian m. carlson" <sandals@crustytoothpaste.ath.cx> wrote:
> On Mon, Dec 03, 2007 at 10:35:33AM +0000, Johannes Schindelin wrote:
> >On Mon, 3 Dec 2007, brian m. carlson wrote:
> >
> >>Any program using getopt or getopt_long will stop processing options 
> >>once a non-option argument has been encountered, if POSIXLY_CORRECT is 
> >>set.
...
> >Besides, you probably want to send this as a git-gui patch: based on 
> >git-gui.git, not git.git, and Cc'ed to Shawn Pearce.
> 
> Thanks.  Will do.

Don't bother.  I already did the necesary work to apply this patch
to the git-gui.git tree.  It was small, obviously correct, and easy
to fix up to make it apply to git-gui.git.  Its already pushed out
in my master branch and will be in gitgui-0.9.1.

-- 
Shawn.

```
