git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: git: avoiding merges, rebasing
       [not found]     ` <200710021350.54625.bruno@clisp.org>
@ 2007-10-02 12:16       ` Eric Blake
  2007-10-03 21:31         ` making "git stash" safer to use Bruno Haible
  2007-10-19 13:37         ` stash clear, was Re: git: avoiding merges, rebasing Johannes Schindelin
       [not found]       ` <6C9F1445-8826-4E6F-A10C-290A57A4C826@lrde.epita.fr>
  1 sibling, 2 replies; 15+ messages in thread
From: Eric Blake @ 2007-10-02 12:16 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib, git

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[adding the git list]

According to Bruno Haible on 10/2/2007 5:50 AM:
> Hello Benoit,
> 
>>>     $ git stash
>>>     $ git pull
>>>     $ git stash apply
>>>     $ git stash clean              ; typo!
>>>     $ git stash clear              ; fatal correction to typo!
>>>
>>> and lost 20 modified files. Well, not really lost. Just took me a  
>>> while to
>> I don't really see how and why you "lost 20 modified files".
> 
> I lost modifications to 20 files. "git stash clean" moved these modifications
> into a stash named "clean", and "git stash clear" killed it.

While we're at it, I wish 'git stash clear' would take an optional
argument that says which stash(es) to clear, rather than blindly clearing
the entire stash.

Short of that, there's always manually editing .git/logs/refs/stash, to
delete the lines to the stashes you no longer need, without killing the
ones you want kept.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHAjaY84KuGfSFAYARAjqCAJ9qRzVxWpujzTGU9zdDi1UkQiSLggCeMien
LJhXdjlNHQYv0BUMCyZQo20=
=xPKQ
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 15+ messages in thread

* making "git stash" safer to use
  2007-10-02 12:16       ` git: avoiding merges, rebasing Eric Blake
@ 2007-10-03 21:31         ` Bruno Haible
  2007-10-03 21:36           ` Junio C Hamano
  2007-10-04  8:40           ` Joachim B Haga
  2007-10-19 13:37         ` stash clear, was Re: git: avoiding merges, rebasing Johannes Schindelin
  1 sibling, 2 replies; 15+ messages in thread
From: Bruno Haible @ 2007-10-03 21:31 UTC (permalink / raw)
  To: git; +Cc: Benoit SIGOURE, Eric Blake

Hi,

Through a simple typo I lost modifications to 20 files:

> >>>     $ git stash
> >>>     $ git pull
> >>>     $ git stash apply
> >>>     $ git stash clean              # typo!
> >>>     $ git stash clear              # fatal correction to typo!

It is just too easy to lose your modifications by using "git stash".

Eric Blake further says:

> While we're at it, I wish 'git stash clear' would take an optional
> argument that says which stash(es) to clear, rather than blindly clearing
> the entire stash.

It would help if git would store which of the stashes were applied since
they were created and which were not. A stash that was not yet applied must
be considered "precious", whereas a stash that was applied is redundant,
right?

According these lines, how about
  1) changing "git stash clear" to remove only the redundant stashes,
     (or alternatively: let it fail if there is at least one precious stash),
  2) adding an option -f, so that "git stash -f clear" clears all stashes,
     including the precious ones.

The rationale is that humans are bad at remembering the state of something.
Therefore instead of having a command that is commonly used in one state
and dangerous in the other state, better have two different commands - one
for the common case, and one for the dangerous one. Like "rm" and "rm -f".

Bruno

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: making "git stash" safer to use
  2007-10-03 21:31         ` making "git stash" safer to use Bruno Haible
@ 2007-10-03 21:36           ` Junio C Hamano
  2007-10-04  8:40           ` Joachim B Haga
  1 sibling, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2007-10-03 21:36 UTC (permalink / raw)
  To: Bruno Haible; +Cc: git, Benoit SIGOURE, Eric Blake

Bruno Haible <bruno@clisp.org> writes:

>> While we're at it, I wish 'git stash clear' would take an optional
>> argument that says which stash(es) to clear, rather than blindly clearing
>> the entire stash.
>
> It would help if git would store which of the stashes were applied since
> they were created and which were not. A stash that was not yet applied must
> be considered "precious", whereas a stash that was applied is redundant,
> right?

Wrong.  I would say all stash entries are precious unless you
explicitly say "I'm done with it".  The problem is that we do
not have a way to say it explicitly.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: git: avoiding merges, rebasing
       [not found]       ` <6C9F1445-8826-4E6F-A10C-290A57A4C826@lrde.epita.fr>
@ 2007-10-03 23:01         ` Bruno Haible
  0 siblings, 0 replies; 15+ messages in thread
From: Bruno Haible @ 2007-10-03 23:01 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: bug-gnulib, git

Benoit SIGOURE wrote:
> >>> Is there some shorthand for this process, such as a "git-recover"
> >>> command?
> >>
> >> you can run git fsck and look for
> >> a dangling commit (which can be inspected with git show <sha1>) where
> >> you are most likely to find your stash (unless you run git-gc or this
> >> sort of thing).
> >
> > Cool! This information would be worth mentioning in the git-stash  
> > manual page or in an FAQ. It can be a real life-saver.
> 
> True.  Propose a patch :-)

Here's a proposed patch.

--- git-1.5.3.4/Documentation/git-stash.txt.bak	2007-10-03 21:44:53.000000000 +0200
+++ git-1.5.3.4/Documentation/git-stash.txt	2007-10-04 01:00:48.000000000 +0200
@@ -154,6 +154,28 @@
 ... continue hacking ...
 ----------------------------------------------------------------
 
+Recovering a lost stash::
+
+`git stash clear` clears all stashes without asking for confirmation.
+If you did not intend this, you can recover the lost changes by running
+`git fsck`, looking for dangling commits, and using `git show <commit>`.
++
+----------------------------------------------------------------
+... hack hack hack ...
+$ git stash
+... hack no coffee hack ...
+$ git stash clear
+... panic panic ...
+$ git fsck
+dangling commit f62c4fa05422fd4fb8610bdb02a7160121657893
+dangling commit 773024d2ffc33ac80baddcf2b673535b627af0da
+dangling commit 9e509390a2b26b562f3b008eacc65b6765d48339
+$ git show 773024d2ffc33ac80baddcf2b673535b627af0da
+$ git diff 773024d2ffc33ac80baddcf2b673535b627af0da > recovered.diff
+$ patch -p0 -R < recovered.diff
+... continue hacking ...
+----------------------------------------------------------------
+
 SEE ALSO
 --------
 gitlink:git-checkout[1],

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: making "git stash" safer to use
  2007-10-03 21:31         ` making "git stash" safer to use Bruno Haible
  2007-10-03 21:36           ` Junio C Hamano
@ 2007-10-04  8:40           ` Joachim B Haga
  2007-10-04 20:59             ` David Kastrup
  1 sibling, 1 reply; 15+ messages in thread
From: Joachim B Haga @ 2007-10-04  8:40 UTC (permalink / raw)
  To: git

> Through a simple typo I lost modifications to 20 files:
>
>> >>>     $ git stash
>> >>>     $ git pull
>> >>>     $ git stash apply
>> >>>     $ git stash clean              # typo!
>> >>>     $ git stash clear              # fatal correction to typo!
>
> It is just too easy to lose your modifications by using "git stash".

What makes it most dangerous is that there is no differentiation
between a name and a command in the same position. I'd argue that 
either the command should be mandatory:

git stash save mywork
git stash apply mywork
git stash clear mywork
git stash mywork       # error

(we can still keep today's shortcuts "git stash" and "git stash apply", 
but only for the un-named case),

or that the command should be of the option type:

git stash mywork
git stash --apply mywork
git stash --clear mywork


-j.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: making "git stash" safer to use
  2007-10-04  8:40           ` Joachim B Haga
@ 2007-10-04 20:59             ` David Kastrup
  0 siblings, 0 replies; 15+ messages in thread
From: David Kastrup @ 2007-10-04 20:59 UTC (permalink / raw)
  To: Joachim B Haga; +Cc: git

Joachim B Haga <cjhaga@fys.uio.no> writes:

> What makes it most dangerous is that there is no differentiation
> between a name and a command in the same position. I'd argue that
> either the command should be mandatory:
>
> git stash save mywork
> git stash apply mywork
> git stash clear mywork
> git stash mywork       # error
>
> (we can still keep today's shortcuts "git stash" and "git stash apply", 
> but only for the un-named case),
>
> or that the command should be of the option type:
>
> git stash mywork
> git stash --apply mywork
> git stash --clear mywork

Hear, hear!  I vote for the latter.  The former is still better than
the current state, though.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: git: avoiding merges, rebasing
       [not found]     ` <C64152A3-A5A6-4320-864C-E78E3A60C8E6@lrde.epita.fr>
@ 2007-10-08 13:16       ` Benoit SIGOURE
  2007-10-08 13:17       ` Benoit SIGOURE
  1 sibling, 0 replies; 15+ messages in thread
From: Benoit SIGOURE @ 2007-10-08 13:16 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib, git list

[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]

On Sep 30, 2007, at 10:27 PM, Benoit SIGOURE wrote:

> On Sep 30, 2007, at 9:41 PM, Bruno Haible wrote:
>
>>> it should be
>>> possible to create a custom [merge "cl-merge"] in your git config  
>>> file,
>>> which points to a script designed specifically for resolving  
>>> changelog
>>> conflicts
>>
>> I would love such a script, instead of constantly having to do  
>> conflict
>> resolution at the top of ChangeLog.
>>
>
> So would I.  I've had this in my TODO list for a long time so if no  
> one else is willing to give it a try, I can try, but it won't be  
> before next week because my schedule is quite busy until then.
>

I finally found some time to hack something and here is my git-merge- 
changelog Perl script.  I tested it quickly and it seems to work  
fine.  It will mess up the ChangeLog entries when a commit actually  
modifies an existing ChangeLog entry.  It needs more testing but I'm  
just throwing this out in the wild for people that have interest in  
this to review.  I will eventually come up with a solution for the  
commits modifying existing entries and a testsuite.

I'm CC-ing the Git ML just in case it interests some more people over  
there.

In order to use it, add the following to your ~/.gitconfig:
[merge "cl-merge"]
         name = GNU-style ChangeLog merge driver
         driver = /path/to/git-merge-changelog %O %A %B
(you can also add it to a specific working copy by adding it in .git/ 
config instead)

Then, in the directory where the ChangeLog is, add a .gitattributes  
file with the following content:
ChangeLog       merge=cl-merge

For more information, see man gitattributes.

Let me know if something goes wrong.

Cheers,

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: git: avoiding merges, rebasing
       [not found]     ` <C64152A3-A5A6-4320-864C-E78E3A60C8E6@lrde.epita.fr>
  2007-10-08 13:16       ` Benoit SIGOURE
@ 2007-10-08 13:17       ` Benoit SIGOURE
  2007-10-09 10:43         ` Johannes Schindelin
  2007-10-09 12:03         ` Bruno Haible
  1 sibling, 2 replies; 15+ messages in thread
From: Benoit SIGOURE @ 2007-10-08 13:17 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib, git list


[-- Attachment #1.1: Type: text/plain, Size: 1799 bytes --]

[as usual, I forgot the attachment...]

On Sep 30, 2007, at 10:27 PM, Benoit SIGOURE wrote:

> On Sep 30, 2007, at 9:41 PM, Bruno Haible wrote:
>
>>> it should be
>>> possible to create a custom [merge "cl-merge"] in your git config  
>>> file,
>>> which points to a script designed specifically for resolving  
>>> changelog
>>> conflicts
>>
>> I would love such a script, instead of constantly having to do  
>> conflict
>> resolution at the top of ChangeLog.
>>
>
> So would I.  I've had this in my TODO list for a long time so if no  
> one else is willing to give it a try, I can try, but it won't be  
> before next week because my schedule is quite busy until then.
>

I finally found some time to hack something and here is my git-merge- 
changelog Perl script.  I tested it quickly and it seems to work  
fine.  It will mess up the ChangeLog entries when a commit actually  
modifies an existing ChangeLog entry.  It needs more testing but I'm  
just throwing this out in the wild for people that have interest in  
this to review.  I will eventually come up with a solution for the  
commits modifying existing entries and a testsuite.

I'm CC-ing the Git ML just in case it interests some more people over  
there.

In order to use it, add the following to your ~/.gitconfig:
[merge "cl-merge"]
         name = GNU-style ChangeLog merge driver
         driver = /path/to/git-merge-changelog %O %A %B
(you can also add it to a specific working copy by adding it in .git/ 
config instead)

Then, in the directory where the ChangeLog is, add a .gitattributes  
file with the following content:
ChangeLog       merge=cl-merge

For more information, see man gitattributes.

Let me know if something goes wrong.

Cheers,

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory


[-- Attachment #1.2: git-merge-changelog --]
[-- Type: application/octet-stream, Size: 6749 bytes --]

#!/usr/bin/env perl
# Define a merge driver to use with Git to merge GNU-style ChangeLog entries.
# Copyright (C) 2007  Benoit Sigoure.

my $VERSION = '2007-10-08 12:33'; # UTC

# 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 the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.

use warnings;
use strict; # Oh yes, spank me baby!

my $usage = "usage: $0 [OPTION] OLD CURRENT OTHERS\n";

# help(VAL)
# ---------
# Print the usage and exit with VAL.
sub help($)
{
  print <<EOF;
$usage
Merge driver for Git to merge GNU-style ChangeLog entries.  OLD is the the
merge ancestors' version, CURRENT is the current version, OTHERS is the
other branches' version.  The result of the merge is left in the file
CURRENT unless the option --output is used.

  --help             display this help and exit
  --version          output version information and exit
  -o, --output=FILE  specify an output file

Report bugs to <tsuna\@lrde.epita.fr>
EOF
  exit (shift);
}

sub version() # subversion is wrong!  Use Git instead!  ;D
{
  print <<EOF;
git-merge-changelog $VERSION
Copyright (C) 2007  Benoit Sigoure
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
EOF
}

my $debug = 0;
# debug(MSG [, NL])
# ----------
# Print MSG on stderr if debugging is enabled.  If NL is not given or is true,
# an additionnal \n is printed.
sub debug($;$)
{
  return if not $debug;
  my ($msg, $nl) = @_;
  print STDERR $msg . (defined($nl) && !$nl ? '' : "\n");
}

# Return value of the script.
my $res = 0;

# error(MSG)
# ----------
# Print MSG on stderr and set the return value to be 1 (does not exit).
sub error($)
{
  print STDERR "@_\n";
  &debug;
  $res = 1;
}

# Output file.
my $output;

# Parse ARGV, return the list of files to merge.
sub parse_options()
{
  use Getopt::Long;
  Getopt::Long::config('bundling', 'pass_through');
  Getopt::Long::GetOptions
    (
     'h|help'        => sub { help(0); },
     'version'       => sub { version; },
     'debug'         => \$debug,
     'o|output=s'    => \$output,
    )
    or die;

  foreach my $arg (@ARGV)
  {
    if ($arg =~ /^-./)
    {
      print STDERR "$0: unrecognized option or bad usage for `$arg'\n";
      print STDERR $usage;
      print STDERR "Try `$0 --help' for more information.\n";
      exit 1;
    }
  }
  return @ARGV;
}

my @input_files = parse_options();
print STDERR $usage and exit(1) if $#input_files != 2;

$output = $input_files[1] unless defined $output;
debug "result of the merge will be written to $output";

foreach my $f (@input_files)
{
  print STDERR "$0: `$f': No such file or not readable\n"
    and exit(1)
    unless -r $f;
}

# Hash of ChangeLog entries.
# The keys are dates of the form YYYY-MM-DD.
# The values are arrays of ChangeLog entries.
my %entries;

# add_entry(DATE, TEXT)
# Add the ChangeLog entry TEXT.  DATE is of the form YYYY-MM-DD.
sub add_entry($$)
{
  my ($date, $entry) = @_;
  return if not defined $date or not defined $entry;

  # Prevent duplicate entries.
  foreach my $i (@{$entries{$date}})
  {
    if ($i eq $entry)
    {
      debug "Duplicate entry $date";
      return;
    }
  }
  debug "Got an entry $date";
  # Add the new entry.
  push (@{$entries{$date}}, $entry);
}

# Optional Copyright notice often found at the end of ChangeLogs.
my $copyright_notice;
# File in which we found the Copyright notice.
my $copyright_notice_file;

foreach my $f (@input_files)
{
  # Buffer for the current ChangeLog entry.
  my $cur_entry;
  # Date of the current ChangeLog entry.
  my $cur_date;

  open(IN, $f) or die("Could not open '$f' for reading: $!");
  debug ">>> processing `$f'";
  while (<IN>)
  {
    if ($_ !~ /^[-0-9]{10} .*@.*/ && defined($cur_entry))
    {
      debug("adding...", 0);
      $cur_entry .= $_;
    }
    elsif (/^([-0-9]{10}) .*@.*/)
    {
      add_entry($cur_date, $cur_entry);
      $cur_date = $1; # Fragile, assumes that add_entry does use RE.
      $cur_entry = $_;
    }
    elsif ($_ !~ /^\s*$/)
    {
      error("$0: $f:$.: Junk line: $_");
    }
  }
  close(IN) or die("Error while closing '$f': $!");

  # The last entry might contain a Copyright notice that needs to be
  # extracted and re-printed last.  We assume that the Copyright notice
  # will be separated from the last ChangeLog entry by one or more
  # blank lines and the Copyright notice starts on the 1st column.
  if (defined($cur_entry) && $cur_entry =~ /^[0-9].*([\r\n]{2}\S.*?)$/s)
  {
    debug "Copyright notice in `$f'? <<<$1>>>";
    if (defined $copyright_notice)
    {
      error("$0: Copyright notices in `$copyright_notice_file'"
            . " and `$f' differ.\n")
        if ($copyright_notice ne $1);
    }
    else
    {
      $copyright_notice = $1;
      $copyright_notice_file = $f;
    }
    $cur_entry = substr($cur_entry, 0, length($1));
  }
  else
  {
    debug "No Copyright notice in `$f'";
  }

  add_entry($cur_date, $cur_entry);
}

# ---------------------- #
# Rebuild the ChangeLog. #
# ---------------------- #

use IO::Handle;
use IO::File;

my $out;
if ($output eq '-')
{
  $out = new IO::Handle;
  $out->fdopen(fileno(STDOUT), "w")
    or die("Error while openning stdout: $!");
}
else
{
  $out = new IO::File($output, '>')
    or die("Could not open '$output' for writing: $!");
}
foreach my $k (sort { $b cmp $a } keys %entries)
{
  foreach my $i (@{$entries{$k}})
  {
    print $out $i;
  }
}

# If we have a Copyright notice, make sure it is terminated by a \n and
# print it.
if (defined $copyright_notice)
{
  # Remove all the new lines at the beginning for the Copyright notice.
  $copyright_notice =~ s/^[\r\n]+//;
  # Ensure there is a trailing new line.
  $copyright_notice =~ s/[^\r\n]$/$&\n/;
  print $out $copyright_notice;
}
$out->close() or die("Error while closing '$output': $!");

debug "exit $res";
exit $res;

## Local Variables:
## eval: (add-hook 'write-file-hooks 'time-stamp)
## time-stamp-start: "$VERSION = '"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC"
## time-stamp-end: "'; # UTC"
## End:

[-- Attachment #1.3: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: git: avoiding merges, rebasing
  2007-10-08 13:17       ` Benoit SIGOURE
@ 2007-10-09 10:43         ` Johannes Schindelin
  2007-10-09 18:06           ` Benoit SIGOURE
  2007-10-09 12:03         ` Bruno Haible
  1 sibling, 1 reply; 15+ messages in thread
From: Johannes Schindelin @ 2007-10-09 10:43 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: Bruno Haible, bug-gnulib, git list

Hi,

On Mon, 8 Oct 2007, Benoit SIGOURE wrote:

> [as usual, I forgot the attachment...]

Two comments:

- by not inlining you made it hard to review your script.  Therefore I 
  will not do it.

- Try to avoid naming the script git-merge-*; these scripts/programs are 
  merge _strategies_, not merge _drivers_ (and yes, we already have two 
  programs violating this rule -- merge-base and merge-file -- but that 
  does not mean that you are free to add to the pile).

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: git: avoiding merges, rebasing
  2007-10-08 13:17       ` Benoit SIGOURE
  2007-10-09 10:43         ` Johannes Schindelin
@ 2007-10-09 12:03         ` Bruno Haible
  2007-10-09 18:19           ` GNU-style ChangeLog merge driver for Git (was: Re: git: avoiding merges, rebasing) Benoit SIGOURE
  1 sibling, 1 reply; 15+ messages in thread
From: Bruno Haible @ 2007-10-09 12:03 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: bug-gnulib, git list

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]

Hello Benoit,

Thanks for working on this. But this merge driver has a few major nits.


1) While my ChangeLog file was locally unmodified but some pulled in commits
   should modify it, "git pull" stopped and said:

ChangeLog: needs update
fatal: Entry 'ChangeLog' not uptodate. Cannot merge.

[I cannot swear on this, because I did not do a "git status" before the
"git pull", but this is in a directory where I usually have no pending diffs.]

The ChangeLog in question is the one from gnulib
(git clone git://git.sv.gnu.org/gnulib).


2) This "merge driver" did much more than sorting in a merge: it sorted the
entire file! In doing so,
  - It changed the order of ChangeLog entries in a way that does not represent
    the historical commit order.
  - For ChangeLog entries with multiple contributors, it shuffled around these
    extra contributors to other ChangeLog entries.
  - Near the end of the file, it made a change that I cannot explain.

Find attached a context diff of all the bad changes that it did.


In my opinion, a merge driver should not do changes to the file except
in the range of lines where the conflict occurred. For a ChangeLog driver,
all uncommitted entries should be collected at the top of the file, because
1. ChangeLogs are kept in the order of historical commit in the central
   repository,
2. other developers always look at the top of the ChangeLog; if a ChangeLog
   entries is inserted second or third after some already present entries,
   the danger is too high that the change gets unnoticed.

So "git-merge-changelog OLD CURRENT OTHERS" should IMO do the following:
1) Collect the changes between OLD and HEAD (I don't know if that is CURRENT
   or OTHERS?), in two categories:
     - added entries,
     - changed and removed entries.
2) Back out the added entries, keeping only the changed and removed entries
   as modifications.
3) Do a normal merge between this and the pulled in remote branch (I don't
   know if that is OTHERS or CURRENT?). If that merge gives a conflict,
   bail out.
4) Insert the added entries at the top, in the same order as they were
   originally (no sorting).

Bruno

[-- Attachment #2: git-merge-changelog-blunder --]
[-- Type: text/x-diff, Size: 43339 bytes --]

*** ChangeLog.orig	2007-10-09 13:16:56.000000000 +0200
--- ChangeLog	2007-10-09 13:12:29.000000000 +0200
***************
*** 3560,3569 ****
  	* doc/functions/lseek.texi: Update.
  	Reported by Gary V. Vaughan <gary@gnu.org>.
  
- 2007-05-28  Bruno Haible  <bruno@clisp.org>
- 
- 	* m4/intl.m4 (AM_INTL_SUBDIR): Substitute variables WOE32, WINDRES.
- 
  2007-05-31  Eric Blake  <ebb9@byu.net>
  
  	* m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Guess no on mingw when
--- 3560,3565 ----
***************
*** 3631,3636 ****
--- 3627,3636 ----
  	* m4/isnanf.m4 (gl_FUNC_ISNANF_NO_LIBM): Avoid syntax error on
  	cross compiles.
  
+ 2007-05-28  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* m4/intl.m4 (AM_INTL_SUBDIR): Substitute variables WOE32, WINDRES.
+ 
  2007-05-28  Eric Blake  <ebb9@byu.net>
  
  	* modules/closein-tests (test_closein_LDADD): Support test on
***************
*** 4310,4319 ****
  	* doc/functions/vsnprintf.texi: Update.
  	* doc/functions/vsprintf.texi: Update.
  
- 2007-05-01  Bruno Haible  <bruno@clisp.org>
- 
- 	* tests/test-argp-2.sh (func_compare): Drop .exe suffix.
- 
  2007-05-03  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use better
--- 4310,4315 ----
***************
*** 4333,4338 ****
--- 4329,4338 ----
  
  2007-05-01  Bruno Haible  <bruno@clisp.org>
  
+ 	* tests/test-argp-2.sh (func_compare): Drop .exe suffix.
+ 
+ 2007-05-01  Bruno Haible  <bruno@clisp.org>
+ 
  	* doc/functions/_Exit_C99.texi: Renamed from doc/functions/_Exit.texi.
  	Reported by Eric Blake.
  	* doc/gnulib.texi (Function Substitutes): Update.
***************
*** 5358,5371 ****
  	* modules/crypto/rijndael-tests: Moved from ../.
  	* modules/crypto/sha1: Moved from ../.
  
- 2007-03-30  James Youngman  <jay@gnu.org>
- 
- 	* tests/test-stat-time.c (prepare_test): use chmod() rather than
- 	rename() to change the ctime of a file (because ctime is unaffected
- 	by rename on jfs2 on AIX 5.1).
- 	(main): Start by doing cleanup, in case a previous run failed leaving
- 	test files behind.
- 
  2007-03-31  Bruno Haible  <bruno@clisp.org>
  
  	Support old proprietary implementations of iconv.
--- 5358,5363 ----
***************
*** 5442,5447 ****
--- 5434,5447 ----
  	gnulib is available through git.
  	* doc/gnulib-tool.texi (CVS Issues): Mention git and svn as well.
  
+ 2007-03-30  James Youngman  <jay@gnu.org>
+ 
+ 	* tests/test-stat-time.c (prepare_test): use chmod() rather than
+ 	rename() to change the ctime of a file (because ctime is unaffected
+ 	by rename on jfs2 on AIX 5.1).
+ 	(main): Start by doing cleanup, in case a previous run failed leaving
+ 	test files behind.
+ 
  2007-03-30  Bruno Haible  <bruno@clisp.org>
  
  	* lib/alloca_.h: Change prefix of double-inclusion guard macro to _GL_.
***************
*** 6010,6019 ****
  	* lib/argp-help.c (fill_in_uparams, canon_doc_option): Cast the
  	arguments of isspace, isalpha, isalnum, isdigit to 'unsigned char'.
  
- 2007-03-22  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/strptime.c (__strptime_internal): Use ANSI C syntax.
- 
  2007-03-23  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* MODULES.html.sh (File system functions): New module write-any-file.
--- 6010,6015 ----
***************
*** 6032,6037 ****
--- 6028,6037 ----
  
  2007-03-22  Bruno Haible  <bruno@clisp.org>
  
+ 	* lib/strptime.c (__strptime_internal): Use ANSI C syntax.
+ 
+ 2007-03-22  Bruno Haible  <bruno@clisp.org>
+ 
  	* lib/poll.c (MSG_PEEK): New fallback definition.
  
  2007-03-22  Bruno Haible  <bruno@clisp.org>
***************
*** 6284,6293 ****
  	* build-aux/bootstrap (gnulib_name): New variable.
  	(gnulib_tool_options): Use it.
  
- 2007-03-13  Simon Josefsson  <simon@josefsson.org>
- 
- 	* tests/test-des.c: Use new namespace.
- 
  2007-03-15  Bruno Haible  <bruno@clisp.org>
  
  	* lib/dummy.c (gl_dummy_symbol): Renamed from 'dummy'.
--- 6284,6289 ----
***************
*** 6364,6369 ****
--- 6360,6369 ----
  	* tests/test-rbtree_oset.c (main): Update.
  	* lib/gl_anytreehash_list1.h (add_to_bucket): Update.
  
+ 2007-03-13  Simon Josefsson  <simon@josefsson.org>
+ 
+ 	* tests/test-des.c: Use new namespace.
+ 
  2007-03-13  Bruno Haible  <bruno@clisp.org>
  
  	* tests/test-stdbool.c (i): Update after last patch.
***************
*** 6386,6395 ****
  	* build-aux/bootstrap: New file.
  	* build-aux/bootstrap.conf: New file, from coreutils.
  
- 2007-03-11  Bruno Haible  <bruno@clisp.org>
- 
- 	* m4/cycle-check.m4 (gl_CYCLE_CHECK): Require AC_C_INLINE.
- 
  2007-03-12  Simon Josefsson  <simon@josefsson.org>
  
  	* lib/des.h, lib/des.c, lib/gc-gnulib.c: Use gl_ namespace, to
--- 6386,6391 ----
***************
*** 6398,6403 ****
--- 6394,6403 ----
  
  2007-03-11  Bruno Haible  <bruno@clisp.org>
  
+ 	* m4/cycle-check.m4 (gl_CYCLE_CHECK): Require AC_C_INLINE.
+ 
+ 2007-03-11  Bruno Haible  <bruno@clisp.org>
+ 
  	* m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): If the test program fails to
  	compile, set LOCALE_TR_UTF8 to 'none' instead of empty.
  
***************
*** 6519,6524 ****
--- 6519,6531 ----
  	* modules/dirname-tests (test_dirname_SOURCES): Remove redundant
  	variable.
  
+ 2007-03-10  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* lib/stdio_.h (__attribute__): New macro.
+ 	(fprintf, vfprintf, printf, vprintf, snprintf, vsnprintf, sprintf,
+ 	vsprintf): Specify __attribute__ __format__ for GCC.
+ 	Suggested by Eric Blake.
+ 
  2007-03-09  Eric Blake  <ebb9@byu.net>
  	and Matthew Woehlke  <mw_triad@users.sourceforge.net>  (tiny change)
  
***************
*** 6527,6539 ****
  	(GL_INT64_T, GL_UINT64_T): New witnesses of whether gnulib 64-bit
  	types are supported.
  
- 2007-03-10  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/stdio_.h (__attribute__): New macro.
- 	(fprintf, vfprintf, printf, vprintf, snprintf, vsnprintf, sprintf,
- 	vsprintf): Specify __attribute__ __format__ for GCC.
- 	Suggested by Eric Blake.
- 
  2007-03-09  Bruno Haible  <bruno@clisp.org>
  
  	* modules/printf-posix-tests: New file.
--- 6534,6539 ----
***************
*** 6661,6703 ****
  
  	* m4/printf.m4: Make the shell script snippets copy&pastable.
  
- 2007-03-02  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/netinet_in_.h: New file.
- 	* m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): Test whether netinet/in.h
- 	is self-contained. Set ABSOLUTE_NETINET_IN_H, HAVE_NETINET_IN_H.
- 	* modules/netinet_in (Files): Add lib/netinet_in_.h.
- 	(Depends-on): Add absolute-header.
- 	(Makefile.am): Substitute ABSOLUTE_NETINET_IN_H, HAVE_NETINET_IN_H
- 	into netinet/in.h.
- 
- 2007-03-03  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/sys_select_.h: New file.
- 	* m4/sys_socket_h.m4 (gl_HEADER_SYS_SELECT): Test whether sys/select.h
- 	is self-contained. Set ABSOLUTE_SYS_SELECT_H, HAVE_SYS_SELECT_H.
- 	* modules/sys_select (Files): Add lib/sys_select_.h.
- 	(Depends-on): Add absolute-header.
- 	(Makefile.am): Substitute ABSOLUTE_SYS_SELECT_H, HAVE_SYS_SELECT_H
- 	into sys/select.h.
- 
- 2007-03-02  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/socket_.h: If sys/socket.h exists, include that and <sys/types.h>
- 	before it. Turn HAVE_WINSOCK2_H and HAVE_WS2TCPIP_H into configute-time
- 	values.
- 	* m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Test also whether
- 	<sys/socket.h> is self-contained. Set ABSOLUTE_SYS_SOCKET_H,
- 	HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H, HAVE_WS2TCPIP_H.
- 	* modules/sys_socket (Depends-on): Add absolute-header.
- 	(Makefile.am): Substitute ABSOLUTE_SYS_SOCKET_H, HAVE_SYS_SOCKET_H,
- 	HAVE_WINSOCK2_H, HAVE_WS2TCPIP_H into sys/socket.h.
- 	(Include): Remove requirement of inclusion of <sys/types.h>.
- 
- 2007-03-02  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/byteswap_.h (bswap_32): Fix formula.
- 
  2007-03-06  Bruno Haible  <bruno@clisp.org>
  
  	* modules/sprintf-posix-tests: New file.
--- 6661,6666 ----
***************
*** 6934,6939 ****
--- 6897,6912 ----
  
  2007-03-03  Bruno Haible  <bruno@clisp.org>
  
+ 	* lib/sys_select_.h: New file.
+ 	* m4/sys_socket_h.m4 (gl_HEADER_SYS_SELECT): Test whether sys/select.h
+ 	is self-contained. Set ABSOLUTE_SYS_SELECT_H, HAVE_SYS_SELECT_H.
+ 	* modules/sys_select (Files): Add lib/sys_select_.h.
+ 	(Depends-on): Add absolute-header.
+ 	(Makefile.am): Substitute ABSOLUTE_SYS_SELECT_H, HAVE_SYS_SELECT_H
+ 	into sys/select.h.
+ 
+ 2007-03-03  Bruno Haible  <bruno@clisp.org>
+ 
  	* modules/relocatable-prog (Depends-on): Add back progreloc's
  	dependencies: canonicalize-lgpl, xalloc, xreadlink, stdbool, unistd.
  
***************
*** 7019,7024 ****
--- 6992,7024 ----
  
  2007-03-02  Bruno Haible  <bruno@clisp.org>
  
+ 	* lib/netinet_in_.h: New file.
+ 	* m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): Test whether netinet/in.h
+ 	is self-contained. Set ABSOLUTE_NETINET_IN_H, HAVE_NETINET_IN_H.
+ 	* modules/netinet_in (Files): Add lib/netinet_in_.h.
+ 	(Depends-on): Add absolute-header.
+ 	(Makefile.am): Substitute ABSOLUTE_NETINET_IN_H, HAVE_NETINET_IN_H
+ 	into netinet/in.h.
+ 
+ 2007-03-02  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* lib/socket_.h: If sys/socket.h exists, include that and <sys/types.h>
+ 	before it. Turn HAVE_WINSOCK2_H and HAVE_WS2TCPIP_H into configute-time
+ 	values.
+ 	* m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Test also whether
+ 	<sys/socket.h> is self-contained. Set ABSOLUTE_SYS_SOCKET_H,
+ 	HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H, HAVE_WS2TCPIP_H.
+ 	* modules/sys_socket (Depends-on): Add absolute-header.
+ 	(Makefile.am): Substitute ABSOLUTE_SYS_SOCKET_H, HAVE_SYS_SOCKET_H,
+ 	HAVE_WINSOCK2_H, HAVE_WS2TCPIP_H into sys/socket.h.
+ 	(Include): Remove requirement of inclusion of <sys/types.h>.
+ 
+ 2007-03-02  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* lib/byteswap_.h (bswap_32): Fix formula.
+ 
+ 2007-03-02  Bruno Haible  <bruno@clisp.org>
+ 
  	* modules/gettext (configure.ac): Require gettext infrastructure
  	from version 0.16.1.
  
***************
*** 7116,7147 ****
  	* modules/xreadlink (Maintainer): Add my name.
  	* modules/xreadlink-with-size (Depends-on): Alphabetize.
  
- 2007-02-26  Ben Pfaff  <blp@cs.stanford.edu>
- 	    Bruno Haible  <bruno@clisp.org>
- 
- 	* build-aux/install-reloc: Compile also c-ctype.c.
- 	* build-aux/relocatable.sh.in: New file.
- 	* doc/relocatable.texi: New file.
- 	* doc/relocatable-maint.texi: New file.
- 	* doc/gnulib.texi: Include relocatable-maint.texi.
- 	* lib/progreloc.c: Include unistd.h unconditionally.
- 	* lib/relocwrapper.c: Include unistd.h unconditionally.
- 	Include c-ctype.h.
- 	(add_dotbin): Use c_tolower.
- 	* m4/relocatable-lib.m4: New file, extracted from m4/relocatable.m4.
- 	(gl_RELOCATABLE_LIBRARY): Renamed from AC_RELOCATABLE_LIBRARY.
- 	(gl_RELOCATABLE_NOP): Renamed from AC_RELOCATABLE_NOP.
- 	* m4/relocatable.m4 (AC_RELOCATABLE_LIBRARY, AC_RELOCATABLE_NOP): Move
- 	to m4/relocatable-lib.m4.
- 	(gl_RELOCATABLE): Renamed from AC_RELOCATABLE. Set also
- 	RELOCATABLE_CONFIG_H_DIR, RELOCATABLE_SRC_DIR, RELOCATABLE_BUILD_DIR.
- 	(gl_RELOCATABLE_BODY): Renamed from AC_RELOCATABLE_BODY. Don't
- 	require obsolete macro AC_EXEEXT. Don't check for unistd.h. Don't set
- 	SET_RELOCATABLE. Instead set RELOCATABLE_LDFLAGS, INSTALL_PROGRAM_ENV.
- 	* modules/relocatable: New file.
- 	* modules/relocatable-lib: New file.
- 	* modules/relocatable-script: New file.
- 
  2007-02-28  Bruno Haible  <bruno@clisp.org>
  
  	Import --enable-relocatable infrastructure.
--- 7116,7121 ----
***************
*** 7175,7180 ****
--- 7149,7180 ----
  	xreadlink-with-size.
  	* lib/canonicalize.c (canonicalize_filename_mode): Update.
  
+ 2007-02-26  Ben Pfaff  <blp@cs.stanford.edu>
+ 	    Bruno Haible  <bruno@clisp.org>
+ 
+ 	* build-aux/install-reloc: Compile also c-ctype.c.
+ 	* build-aux/relocatable.sh.in: New file.
+ 	* doc/relocatable.texi: New file.
+ 	* doc/relocatable-maint.texi: New file.
+ 	* doc/gnulib.texi: Include relocatable-maint.texi.
+ 	* lib/progreloc.c: Include unistd.h unconditionally.
+ 	* lib/relocwrapper.c: Include unistd.h unconditionally.
+ 	Include c-ctype.h.
+ 	(add_dotbin): Use c_tolower.
+ 	* m4/relocatable-lib.m4: New file, extracted from m4/relocatable.m4.
+ 	(gl_RELOCATABLE_LIBRARY): Renamed from AC_RELOCATABLE_LIBRARY.
+ 	(gl_RELOCATABLE_NOP): Renamed from AC_RELOCATABLE_NOP.
+ 	* m4/relocatable.m4 (AC_RELOCATABLE_LIBRARY, AC_RELOCATABLE_NOP): Move
+ 	to m4/relocatable-lib.m4.
+ 	(gl_RELOCATABLE): Renamed from AC_RELOCATABLE. Set also
+ 	RELOCATABLE_CONFIG_H_DIR, RELOCATABLE_SRC_DIR, RELOCATABLE_BUILD_DIR.
+ 	(gl_RELOCATABLE_BODY): Renamed from AC_RELOCATABLE_BODY. Don't
+ 	require obsolete macro AC_EXEEXT. Don't check for unistd.h. Don't set
+ 	SET_RELOCATABLE. Instead set RELOCATABLE_LDFLAGS, INSTALL_PROGRAM_ENV.
+ 	* modules/relocatable: New file.
+ 	* modules/relocatable-lib: New file.
+ 	* modules/relocatable-script: New file.
+ 
  2007-02-25  Jim Meyering  <jim@meyering.net>
  
  	* build-aux/announce-gen: When complaining about excess arguments,
***************
*** 7277,7282 ****
--- 7277,7289 ----
  	* modules/stdint-tests: Likewise.
  	* modules/tls-tests: Likewise.
  
+ 2007-02-25  Jim Meyering  <jim@meyering.net>
+ 
+ 	Avoid conflicting types for 'unsetenv' on FreeBSD.
+ 	* lib/putenv.c (_unsetenv): Rename from "unsetenv", to avoid
+ 	conflicting with FreeBSD's (5.0 and 6.1) function declaration
+ 	in stdlib.h.
+ 
  2007-02-24  Bruno Haible  <bruno@clisp.org>
  
  	* lib/isnanl.h (isnanl): Define through isnan if isnan is a macro.
***************
*** 7294,7306 ****
  	* lib/isnanl.c: Remove all code. Just include isnan.c.
  	* modules/isnanl-nolibm (Files): Add lib/isnan.c.
  
- 2007-02-25  Jim Meyering  <jim@meyering.net>
- 
- 	Avoid conflicting types for 'unsetenv' on FreeBSD.
- 	* lib/putenv.c (_unsetenv): Rename from "unsetenv", to avoid
- 	conflicting with FreeBSD's (5.0 and 6.1) function declaration
- 	in stdlib.h.
- 
  2007-02-24  Bruno Haible  <bruno@clisp.org>
  
  	* modules/isnanl-nolibm-tests: New file.
--- 7301,7306 ----
***************
*** 8439,8469 ****
  	* modules/nanosleep (Link): New section.
  	* modules/readline (Link): New section.
  
- 2007-01-27  Bruno Haible  <bruno@clisp.org>
- 
- 	Enforce the use of gnulib modules for unportable <string.h> functions.
- 	* m4/string_h.m4 (gl_STRING_MODULE_INDICATOR): New macro.
- 	(gl_STRING_MODULE_INDICATOR_DEFAULTS): New macro.
- 	(gl_HEADER_STRING_H_BODY): Require it.
- 	* lib/string_.h: If the gnulib module XYZ is not present, redefine
- 	the symbol XYZ to one that gives a link error.
- 	* modules/string (Makefile.am): Also substitute the GNULIB_* variables.
- 	* modules/memmem (configure.ac): Invoke gl_STRING_MODULE_INDICATOR.
- 	* modules/mempcpy (configure.ac): Likewise.
- 	* modules/memrchr (configure.ac): Likewise.
- 	* modules/stpcpy (configure.ac): Likewise.
- 	* modules/stpncpy (configure.ac): Likewise.
- 	* modules/strcase (configure.ac): Likewise.
- 	* modules/strcasestr (configure.ac): Likewise.
- 	* modules/strchrnul (configure.ac): Likewise.
- 	* modules/strdup (configure.ac): Likewise.
- 	* modules/strndup (configure.ac): Likewise.
- 	* modules/strnlen (configure.ac): Likewise.
- 	* modules/strpbrk (configure.ac): Likewise.
- 	* modules/strsep (configure.ac): Likewise.
- 	* modules/strstr (configure.ac): Likewise.
- 	* modules/strtok_r (configure.ac): Likewise.
- 
  2007-01-31  Jean-Louis Martineau  <martineau@zmanda.com>  (tiny change)
  
  	* lib/gai_strerror.c (values): Add EAI_OVERFLOW.
--- 8439,8444 ----
***************
*** 8582,8587 ****
--- 8557,8587 ----
  
  2007-01-27  Bruno Haible  <bruno@clisp.org>
  
+ 	Enforce the use of gnulib modules for unportable <string.h> functions.
+ 	* m4/string_h.m4 (gl_STRING_MODULE_INDICATOR): New macro.
+ 	(gl_STRING_MODULE_INDICATOR_DEFAULTS): New macro.
+ 	(gl_HEADER_STRING_H_BODY): Require it.
+ 	* lib/string_.h: If the gnulib module XYZ is not present, redefine
+ 	the symbol XYZ to one that gives a link error.
+ 	* modules/string (Makefile.am): Also substitute the GNULIB_* variables.
+ 	* modules/memmem (configure.ac): Invoke gl_STRING_MODULE_INDICATOR.
+ 	* modules/mempcpy (configure.ac): Likewise.
+ 	* modules/memrchr (configure.ac): Likewise.
+ 	* modules/stpcpy (configure.ac): Likewise.
+ 	* modules/stpncpy (configure.ac): Likewise.
+ 	* modules/strcase (configure.ac): Likewise.
+ 	* modules/strcasestr (configure.ac): Likewise.
+ 	* modules/strchrnul (configure.ac): Likewise.
+ 	* modules/strdup (configure.ac): Likewise.
+ 	* modules/strndup (configure.ac): Likewise.
+ 	* modules/strnlen (configure.ac): Likewise.
+ 	* modules/strpbrk (configure.ac): Likewise.
+ 	* modules/strsep (configure.ac): Likewise.
+ 	* modules/strstr (configure.ac): Likewise.
+ 	* modules/strtok_r (configure.ac): Likewise.
+ 
+ 2007-01-27  Bruno Haible  <bruno@clisp.org>
+ 
  	* modules/unistr/base: Update.
  
  2007-01-27  Bruno Haible  <bruno@clisp.org>
***************
*** 9257,9264 ****
  	HAVE_GETTIMEOFDAY && !GETTIMEOFDAY_CLOBBERS_LOCALTIME. Use the
  	maximum possible value for tv->tv_usec, rather than the minimum one.
  
- 2005-10-08  Martin Lambers  <marlam@marlam.de>
- 2005-10-08  Paul Eggert  <eggert@cs.ucla.edu>
  2007-01-16  Bruno Haible  <bruno@clisp.org>
  
  	* modules/gettimeofday (Files): Add lib/gettimeofday.h.
--- 9257,9262 ----
***************
*** 9407,9449 ****
  	* modules/fchdir (Depends-on): Add absolute-header.
  	* modules/unistd (Depends-on): Likewise.
  
- 2006-12-30  Bruno Haible  <bruno@clisp.org>
- 
- 	* modules/fchdir: New file.
- 	* modules/unistd (Files): Add lib/unistd_.h.
- 	(Makefile.am): Generate unistd.h from unistd_.h.
- 	* lib/fchdir.c: New file.
- 	* lib/dirent_.h: New file.
- 	* lib/unistd_.h: New file.
- 	* lib/fcntl_.h (open) [FCHDIR_REPLACEMENT]: New replacement.
- 	* m4/fchdir.m4: New file.
- 	* m4/unistd_h.m4 (gl_PREREQ_UNISTD): New macro.
- 	(gl_HEADER_UNISTD): Invoke it.
- 	* lib/dup-safer.c (dup_safer) [FCHDIR_REPLACEMENT]: Use the dup
- 	function.
- 	* lib/backupfile.c (opendir, closedir): Undefine.
- 	* lib/chown.c (open, close): Undefine.
- 	* lib/clean-temp.c (open, close): Undefine.
- 	* lib/copy-file.c (open, close): Undefine.
- 	* lib/execute.c (open, close): Undefine.
- 	* lib/fsusage.c (open, close): Undefine.
- 	* lib/gc-gnulib.c (open, close): Undefine.
- 	* lib/getcwd.c (opendir, closedir): Undefine.
- 	* lib/glob.c (opendir, closedir): Undefine.
- 	* lib/javacomp.c (open, close): Undefine.
- 	* lib/mountlist.c (open, close, opendir, closedir): Undefine.
- 	* lib/openat-proc.c (open, close): Undefine.
- 	* lib/pagealign_alloc.c (open, close): Undefine.
- 	* lib/pipe.c (open, close): Undefine.
- 	* lib/progreloc.c (open, close): Undefine.
- 	* lib/savedir.c (opendir, closedir): Undefine.
- 	* lib/utime.c (open, close): Undefine.
- 	* MODULES.html.sh (Support for systems lacking POSIX:2001): Add fchdir.
- 
- 2007-01-10  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/striconv.c (mem_cd_iconv): Align the temporary buffer.
- 
  2007-01-12  Eric Blake  <ebb9@byu.net>
  
  	Provide a robust <wchar.h>.  Further simplifications are now
--- 9405,9410 ----
***************
*** 9474,9479 ****
--- 9435,9444 ----
  	* gnulib-tool (func_all_modules): Exclude all files inside the CVS
  	directory.
  
+ 2007-01-10  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* lib/striconv.c (mem_cd_iconv): Align the temporary buffer.
+ 
  2007-01-10  Paul Eggert  <eggert@cs.ucla.edu>
  
  	Use @...@ consistently in lib/wctype_.h.
***************
*** 9842,9859 ****
  	* lib/fts.c: Likewise.
  	* modules/fts (configure.ac): Use gl_MODULE_INDICATOR.
  
- 2006-12-25  Bruno Haible  <bruno@clisp.org>
- 
- 	* modules/utf8-ucs4-safe: New file.
- 	* lib/utf8-ucs4-safe.h: New file.
- 	* lib/unistr/utf8-ucs4-safe.c: New file.
- 
- 	* modules/utf16-ucs4-safe: New file.
- 	* lib/utf16-ucs4-safe.h: New file.
- 	* lib/unistr/utf16-ucs4-safe.c: New file.
- 
- 	* MODULES.html.sh (Unicode string functions): Add the new modules.
- 
  2007-01-08  Bruno Haible  <bruno@clisp.org>
  
  	* modules/utf8-ucs4 (Files, lib_SOURCES): Add unistr/utf8-ucs4.c.
--- 9807,9812 ----
***************
*** 9884,9897 ****
  	(u16_uctomb): Use ucs4_t, uint16_t types.
  	* lib/unistr/ucs4-utf16.c: New file.
  
- 2006-12-25  Bruno Haible  <bruno@clisp.org>
- 
- 	* modules/unitypes: New file.
- 	* lib/unitypes.h: New file.
- 	* MODULES.html.sh (func_all_modules): New section "Unicode string
- 	functions". Move ucs4-utf8, ucs4-utf16, utf8-ucs4, utf16-ucs4 to
- 	this section. Add unitypes.
- 
  2007-01-08  Bruno Haible  <bruno@clisp.org>
  
  	Avoid variable names that conflict with those from libtool.
--- 9837,9842 ----
***************
*** 10018,10027 ****
  	to follow.  Don't set event bits that were not requested (except
  	POLLERR and POLLHUP).
  
- 2007-01-01  Bruno Haible  <bruno@clisp.org>
- 
- 	* modules/lchmod (Include): Require lchmod.h, not lchown.h.
- 
  2007-01-03  Jim Meyering  <jim@meyering.net>
  
  	* modules/fts-lgpl (Depends-on): Add i-ring.  Reported by Bruno Haible.
--- 9963,9968 ----
***************
*** 10033,10038 ****
--- 9974,9983 ----
  
  2007-01-01  Bruno Haible  <bruno@clisp.org>
  
+ 	* modules/lchmod (Include): Require lchmod.h, not lchown.h.
+ 
+ 2007-01-01  Bruno Haible  <bruno@clisp.org>
+ 
  	* gnulib-tool (func_emit_copyright_notice): Bump year.
  	(func_get_autoconf_snippet): Emit a GNULIB_<modulename> macro.
  
***************
*** 10049,10054 ****
--- 9994,10032 ----
  
  	* lib/version-etc.c (COPYRIGHT_YEAR): Bump for new year.
  
+ 2006-12-30  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* modules/fchdir: New file.
+ 	* modules/unistd (Files): Add lib/unistd_.h.
+ 	(Makefile.am): Generate unistd.h from unistd_.h.
+ 	* lib/fchdir.c: New file.
+ 	* lib/dirent_.h: New file.
+ 	* lib/unistd_.h: New file.
+ 	* lib/fcntl_.h (open) [FCHDIR_REPLACEMENT]: New replacement.
+ 	* m4/fchdir.m4: New file.
+ 	* m4/unistd_h.m4 (gl_PREREQ_UNISTD): New macro.
+ 	(gl_HEADER_UNISTD): Invoke it.
+ 	* lib/dup-safer.c (dup_safer) [FCHDIR_REPLACEMENT]: Use the dup
+ 	function.
+ 	* lib/backupfile.c (opendir, closedir): Undefine.
+ 	* lib/chown.c (open, close): Undefine.
+ 	* lib/clean-temp.c (open, close): Undefine.
+ 	* lib/copy-file.c (open, close): Undefine.
+ 	* lib/execute.c (open, close): Undefine.
+ 	* lib/fsusage.c (open, close): Undefine.
+ 	* lib/gc-gnulib.c (open, close): Undefine.
+ 	* lib/getcwd.c (opendir, closedir): Undefine.
+ 	* lib/glob.c (opendir, closedir): Undefine.
+ 	* lib/javacomp.c (open, close): Undefine.
+ 	* lib/mountlist.c (open, close, opendir, closedir): Undefine.
+ 	* lib/openat-proc.c (open, close): Undefine.
+ 	* lib/pagealign_alloc.c (open, close): Undefine.
+ 	* lib/pipe.c (open, close): Undefine.
+ 	* lib/progreloc.c (open, close): Undefine.
+ 	* lib/savedir.c (opendir, closedir): Undefine.
+ 	* lib/utime.c (open, close): Undefine.
+ 	* MODULES.html.sh (Support for systems lacking POSIX:2001): Add fchdir.
+ 
  2006-12-30  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
***************
*** 10121,10126 ****
--- 10099,10124 ----
  	* MODULES.html.sh (Support for building libraries and
  	executables): Document it.
  
+ 2006-12-25  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* modules/utf8-ucs4-safe: New file.
+ 	* lib/utf8-ucs4-safe.h: New file.
+ 	* lib/unistr/utf8-ucs4-safe.c: New file.
+ 
+ 	* modules/utf16-ucs4-safe: New file.
+ 	* lib/utf16-ucs4-safe.h: New file.
+ 	* lib/unistr/utf16-ucs4-safe.c: New file.
+ 
+ 	* MODULES.html.sh (Unicode string functions): Add the new modules.
+ 
+ 2006-12-25  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* modules/unitypes: New file.
+ 	* lib/unitypes.h: New file.
+ 	* MODULES.html.sh (func_all_modules): New section "Unicode string
+ 	functions". Move ucs4-utf8, ucs4-utf16, utf8-ucs4, utf16-ucs4 to
+ 	this section. Add unitypes.
+ 
  2006-12-25  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* gnulib-tool (SED): Remove, undoing previous change.
***************
*** 10363,10380 ****
  
  	* m4/ptrdiff_max.m4: Remove file.
  
- 2006-11-21  Bruno Haible  <bruno@clisp.org>
- 
- 	* m4/eoverflow.m4 (gl_EOVERFLOW): Use AC_COMPUTE_INT instead of
- 	_AC_COMPUTE_INT.
- 	(AC_COMPUTE_INT): Add fallback definition for autoconf < 2.61.
- 	* m4/ptrdiff_max.m4 (gl_PTRDIFF_MAX): Use AC_COMPUTE_INT instead of
- 	_AC_COMPUTE_INT.
- 	(AC_COMPUTE_INT): Add fallback definition for autoconf < 2.61.
- 	* m4/size_max.m4 (gl_SIZE_MAX): Use AC_COMPUTE_INT instead of
- 	_AC_COMPUTE_INT.
- 	(AC_COMPUTE_INT): Add fallback definition for autoconf < 2.61.
- 
  2006-11-28  Jim Meyering  <jim@meyering.net>
  
  	* lib/regcomp.c (parse_branch): Rename local, exp->expr, to avoid
--- 10361,10366 ----
***************
*** 10389,10400 ****
  2006-11-27  Bruno Haible  <bruno@clisp.org>
  	    Paul Eggert  <eggert@cs.ucla.edu>
  
! 	* lib/regex.h (__restrict_arr): Redo logic of #if, for clarity.
! 
! 2006-11-26  Bruno Haible  <bruno@clisp.org>
! 
! 	* gnulib-tool (func_emit_lib_Makefile_am): Initialize also
! 	noinst_LTLIBRARIES.
  
  2006-11-27  Paul Eggert  <eggert@cs.ucla.edu>
  	    Bruno Haible  <bruno@clisp.org>
--- 10375,10381 ----
  2006-11-27  Bruno Haible  <bruno@clisp.org>
  	    Paul Eggert  <eggert@cs.ucla.edu>
  
! 	* lib/regex.h (__restrict_arr): Redo logic of #if, for clarity.
  
  2006-11-27  Paul Eggert  <eggert@cs.ucla.edu>
  	    Bruno Haible  <bruno@clisp.org>
***************
*** 10402,10407 ****
--- 10383,10393 ----
  	* lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Define to 0
  	if compiling with "gcc -ansi".
  
+ 2006-11-26  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* gnulib-tool (func_emit_lib_Makefile_am): Initialize also
+ 	noinst_LTLIBRARIES.
+ 
  2006-11-26  Paul Eggert  <eggert@cs.ucla.edu>
  
  	Fix some incompatibilities with gcc -ansi -pedantic.
***************
*** 10420,10433 ****
  	Don't close an fd more than once. Identical atimes indicate
  	success, not failure.
  
- 2006-11-22  Robinson Mittmann <bob@hoplon.com>  (tiny change)
- 
- 	* lib/sincosl.c (kernel_sinl): Fix typo in threshold.
- 
  2006-11-23  Jim Meyering  <jim@meyering.net>
  
  	* build-aux/announce-gen: New file.  From coreutils.
  
  2006-11-22  Jim Meyering  <jim@meyering.net>
  
  	Work around a compile-time error from the HP-UX 11.00 /bin/cc.
--- 10406,10419 ----
  	Don't close an fd more than once. Identical atimes indicate
  	success, not failure.
  
  2006-11-23  Jim Meyering  <jim@meyering.net>
  
  	* build-aux/announce-gen: New file.  From coreutils.
  
+ 2006-11-22  Robinson Mittmann <bob@hoplon.com>  (tiny change)
+ 
+ 	* lib/sincosl.c (kernel_sinl): Fix typo in threshold.
+ 
  2006-11-22  Jim Meyering  <jim@meyering.net>
  
  	Work around a compile-time error from the HP-UX 11.00 /bin/cc.
***************
*** 10438,10448 ****
  	* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
  	* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Likewise.
  
! 2006-11-20  Bruno Haible  <bruno@clisp.org>
  
! 	* gettext.m4 (AM_GNU_GETTEXT): Revert 2005-07-28 patch: Use
! 	changequote instead of pairs of brackets.
! 	Reported by Andreas Schwab <schwab@suse.de>.
  
  2006-11-21  Jim Meyering  <jim@meyering.net>
  
--- 10424,10440 ----
  	* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
  	* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Likewise.
  
! 2006-11-21  Bruno Haible  <bruno@clisp.org>
  
! 	* m4/eoverflow.m4 (gl_EOVERFLOW): Use AC_COMPUTE_INT instead of
! 	_AC_COMPUTE_INT.
! 	(AC_COMPUTE_INT): Add fallback definition for autoconf < 2.61.
! 	* m4/ptrdiff_max.m4 (gl_PTRDIFF_MAX): Use AC_COMPUTE_INT instead of
! 	_AC_COMPUTE_INT.
! 	(AC_COMPUTE_INT): Add fallback definition for autoconf < 2.61.
! 	* m4/size_max.m4 (gl_SIZE_MAX): Use AC_COMPUTE_INT instead of
! 	_AC_COMPUTE_INT.
! 	(AC_COMPUTE_INT): Add fallback definition for autoconf < 2.61.
  
  2006-11-21  Jim Meyering  <jim@meyering.net>
  
***************
*** 10450,10455 ****
--- 10442,10453 ----
  	so as to remain compatible with older compilers.
  	Patch from Michael Deutschmann.
  
+ 2006-11-20  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* gettext.m4 (AM_GNU_GETTEXT): Revert 2005-07-28 patch: Use
+ 	changequote instead of pairs of brackets.
+ 	Reported by Andreas Schwab <schwab@suse.de>.
+ 
  2006-11-20  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* MODULES.html.sh (File system functions): Add openat.
***************
*** 10507,10519 ****
  	* modules/i-ring (Depends-on): Add verify.
  	(License): Change to LGPL.
  
- 2006-11-16  Paul Eggert  <eggert@cs.ucla.edu>
- 
- 	* modules/getaddinfo (Depends-on): Remove inttostr; add snprintf.
- 	* lib/getaddrinfo.c: Include snprintf.h rather than intprops.h
- 	and inttostr.h.  Use snprintf rather than uinttostr, so that
- 	LGPLed code doesn't depend on GPLed.
- 
  2006-11-17  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* modules/inline (License): Change from GPL to LGPL.
--- 10505,10510 ----
***************
*** 10522,10527 ****
--- 10513,10525 ----
  
  	* modules/d-type (License): Switch to LGPL.
  
+ 2006-11-16  Paul Eggert  <eggert@cs.ucla.edu>
+ 
+ 	* modules/getaddinfo (Depends-on): Remove inttostr; add snprintf.
+ 	* lib/getaddrinfo.c: Include snprintf.h rather than intprops.h
+ 	and inttostr.h.  Use snprintf rather than uinttostr, so that
+ 	LGPLed code doesn't depend on GPLed.
+ 
  2006-11-15  Bruno Haible  <bruno@clisp.org>
  
  	* m4/alloca.m4 (gl_FUNC_ALLOCA): Fix the AC_CACHE_CHECK message.
***************
*** 10573,10591 ****
  
  	* modules/c-ctype (License): Change to LGPL.
  
- 2006-11-12  Bruno Haible  <bruno@clisp.org>
- 
- 	* m4/lib-link.m4 (AC_LIB_LINKFLAGS, AC_LIB_HAVE_LINKFLAGS,
- 	AC_LIB_LINKFLAGS_BODY): Also set a LIB${NAME}_PREFIX variable. Needed
- 	for GNOME libraries, for which the include files are installed in
- 	subdirectories of $prefix/include.
- 
- 2006-11-12  Bruno Haible  <bruno@clisp.org>
- 
- 	* m4/lib-link.m4: Require at least autoconf-2.54.
- 	(AC_LIB_LINKFLAGS_BODY) [autoconf < 2.61]: Turn dots into the library
- 	name to underscores for the --with option.
- 
  2006-11-13  Bruno Haible  <bruno@clisp.org>
  
  	* gnulib-tool (func_create_testdir): Set gl_source_base correctly in
--- 10571,10576 ----
***************
*** 10606,10611 ****
--- 10591,10609 ----
  
  2006-11-12  Bruno Haible  <bruno@clisp.org>
  
+ 	* m4/lib-link.m4 (AC_LIB_LINKFLAGS, AC_LIB_HAVE_LINKFLAGS,
+ 	AC_LIB_LINKFLAGS_BODY): Also set a LIB${NAME}_PREFIX variable. Needed
+ 	for GNOME libraries, for which the include files are installed in
+ 	subdirectories of $prefix/include.
+ 
+ 2006-11-12  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* m4/lib-link.m4: Require at least autoconf-2.54.
+ 	(AC_LIB_LINKFLAGS_BODY) [autoconf < 2.61]: Turn dots into the library
+ 	name to underscores for the --with option.
+ 
+ 2006-11-12  Bruno Haible  <bruno@clisp.org>
+ 
  	* gnulib-tool (func_emit_lib_Makefile_am): Replace occurrences of
  	'$(top_srcdir)/build-aux/', taking into account the real auxdir.
  
***************
*** 10681,10696 ****
  
  	* lib/fts.c [FTS_DEBUG]: Don't try to print a pointer via %s.
  
- 2006-11-09  Paul Eggert  <eggert@cs.ucla.edu>
- 
- 	* lib/gettext.h (dgettext, dcgettext, ngettext) [! ENABLE_NLS]:
- 	(dngettext, dcngettext, bindtextdomain) [! ENABLE_NLS]:
- 	(bind_textdomain_codeset) [! ENABLE_NLS]:
- 	Evaluate all the arguments.  That way, callers get compatible behavior
- 	if the arguments have side effects.  Also, it avoids some GCC
- 	diagnostics in some cases; Joel E. Denny reported problems when Bison
- 	was configured with --enable-gcc-warnigs.
- 
  2006-11-10  Jim Meyering  <jim@meyering.net>
  
  	* m4/inline.m4 (gl_INLINE): Check with the compiler, not cpp, so that
--- 10679,10684 ----
***************
*** 10707,10712 ****
--- 10695,10710 ----
  
  2006-11-09  Paul Eggert  <eggert@cs.ucla.edu>
  
+ 	* lib/gettext.h (dgettext, dcgettext, ngettext) [! ENABLE_NLS]:
+ 	(dngettext, dcngettext, bindtextdomain) [! ENABLE_NLS]:
+ 	(bind_textdomain_codeset) [! ENABLE_NLS]:
+ 	Evaluate all the arguments.  That way, callers get compatible behavior
+ 	if the arguments have side effects.  Also, it avoids some GCC
+ 	diagnostics in some cases; Joel E. Denny reported problems when Bison
+ 	was configured with --enable-gcc-warnigs.
+ 
+ 2006-11-09  Paul Eggert  <eggert@cs.ucla.edu>
+ 
  	* lib/stdint_.h (uintmax_t): Fix typo: int64_t -> uint64_t.
  	Problem reported by Matthew Woehlke.
  
***************
*** 10949,10959 ****
  
  	* m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Allow C++ configuration.
  
- 2006-10-29  Bruno Haible  <bruno@clisp.org>
- 
- 	Make it compile in C++ mode.
- 	* lib/full-write.c (full_rw): Add a cast.
- 
  2006-11-01  Bruno Haible  <bruno@clisp.org>
  
  	* gnulib-tool (func_get_automake_snippet): Change sed_combine_lines to
--- 10947,10952 ----
***************
*** 10989,10994 ****
--- 10982,10992 ----
  2006-10-29  Bruno Haible  <bruno@clisp.org>
  
  	Make it compile in C++ mode.
+ 	* lib/full-write.c (full_rw): Add a cast.
+ 
+ 2006-10-29  Bruno Haible  <bruno@clisp.org>
+ 
+ 	Make it compile in C++ mode.
  	* lib/striconv.c (mem_cd_iconv): Cast malloc/realloc result.
  	* lib/strnlen1.c (strnlen1): Cast memchr result.
  	* lib/mbchar.h (mb_copy): Rename arguments to 'new_mbc', 'old_mbc'.
***************
*** 11000,11013 ****
  	* lib/linebreak.c (mbs_width_linebreaks): Cast malloc result.
  	* lib/wait-process.c (register_slave_subprocess): Likewise.
  
- 2006-10-22  Bruno Haible  <bruno@clisp.org>
- 
- 	* modules/tsearch: New file.
- 	* lib/tsearch.h: New file.
- 	* lib/tsearch.c: New file, from glibc-2.5 with small modifications.
- 	* m4/tsearch.m4: New file.
- 	* MODULES.html.sh (Support for systems lacking POSIX:2001): Add tsearch.
- 
  2006-10-29  Eric Blake  <ebb9@byu.net>
  
  	* lib/arcfour.c: Assume config.h.
--- 10998,11003 ----
***************
*** 11190,11203 ****
  	* MODULES.html.sh: Remove uinttostr.  It's not a module.
  	Reported by Karl Berry.
  
- 2006-10-23  Bruno Haible  <bruno@clisp.org>
- 
- 	* lib/fts.c (fts_build): Move variable declaration, for C89 compliance.
- 
  2006-10-24  Bruno Haible  <bruno@clisp.org>
  
  	* lib/gl_list.h: Use C comment style, not C++ comment style.
  
  2006-10-23  Eric Blake  <ebb9@byu.net>
  
  	* lib/getaddrinfo.c (includes): Add missing include.
--- 11180,11193 ----
  	* MODULES.html.sh: Remove uinttostr.  It's not a module.
  	Reported by Karl Berry.
  
  2006-10-24  Bruno Haible  <bruno@clisp.org>
  
  	* lib/gl_list.h: Use C comment style, not C++ comment style.
  
+ 2006-10-23  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* lib/fts.c (fts_build): Move variable declaration, for C89 compliance.
+ 
  2006-10-23  Eric Blake  <ebb9@byu.net>
  
  	* lib/getaddrinfo.c (includes): Add missing include.
***************
*** 11218,11223 ****
--- 11208,11234 ----
  	__argc, __argv from the declaration. (They are defined as macros on
  	mingw.)
  
+ 2006-10-23  Jim Meyering  <jim@meyering.net>
+ 
+ 	* lib/getaddrinfo.c (getnameinfo): Use new lightweight uinttostr,
+ 	in place of snprintf.
+ 
+ 	* modules/inttostr (Files): Add lib/uinttostr.c.
+ 	* lib/uinttostr.c (inttostr): New file/function.
+ 	* lib/inttostr.h (uinttostr): Declare.
+ 	* m4/inttostr.m4: Add AC_LIBOBJ([uinttostr]).
+ 	* MODULES.html.sh (Numeric conversion functions <stdlib.h>):
+ 	Add uinttostr.
+ 	* modules/getaddrinfo (Depends-on): Remove snprintf.  Add inttostr.
+ 
+ 2006-10-22  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* modules/tsearch: New file.
+ 	* lib/tsearch.h: New file.
+ 	* lib/tsearch.c: New file, from glibc-2.5 with small modifications.
+ 	* m4/tsearch.m4: New file.
+ 	* MODULES.html.sh (Support for systems lacking POSIX:2001): Add tsearch.
+ 
  2006-10-22  Bruno Haible  <bruno@clisp.org>
  
  	* doc/gnulib-intro.texi: New file.
***************
*** 11234,11252 ****
  	Change mostlyclean-local rule to avoid sh syntax error from bash
  	versions 2.00..2.05 when $(MOSTLYCLEANDIRS) is empty.
  
- 2006-10-23  Jim Meyering  <jim@meyering.net>
- 
- 	* lib/getaddrinfo.c (getnameinfo): Use new lightweight uinttostr,
- 	in place of snprintf.
- 
- 	* modules/inttostr (Files): Add lib/uinttostr.c.
- 	* lib/uinttostr.c (inttostr): New file/function.
- 	* lib/inttostr.h (uinttostr): Declare.
- 	* m4/inttostr.m4: Add AC_LIBOBJ([uinttostr]).
- 	* MODULES.html.sh (Numeric conversion functions <stdlib.h>):
- 	Add uinttostr.
- 	* modules/getaddrinfo (Depends-on): Remove snprintf.  Add inttostr.
- 
  2006-10-21  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* lib/canonicalize.c (ELOOP): Define if not already defined.
--- 11245,11250 ----
***************
*** 11290,11298 ****
  	* gnulib-tool (func_create_testdir): Don't include ftruncate and
  	mountlist by default.
  
! 2006-10-16  Bruno Haible  <bruno@clisp.org>
  
! 	* lib/c-strstr.c: Include c-strstr.h.
  
  2006-10-18  Charles Wilson  <cygwin@cwilson.fastmail.fm>
  
--- 11288,11306 ----
  	* gnulib-tool (func_create_testdir): Don't include ftruncate and
  	mountlist by default.
  
! 2006-10-19  Paul Eggert  <eggert@cs.ucla.edu>
  
! 	* lib/xstrtol.h: Include gettext.h.
! 	(_STRTOL_ERROR): Wrap English-language formats inside gettext.
! 	Problem reported by Eric Blake.
! 	* modules/xstrtol (Depends-on): Add gettext-h.
! 
! 2006-10-19  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
! 
! 	* lib/strftime.c (advance): New macro.
! 	(add): Use it to avoid adding 0 to a FILE *.  FILE can be an
! 	incomplete type, so you can't add 0 to it.  Problem and patch
! 	reported by Eelco Dolstra for dietlibc.
  
  2006-10-18  Charles Wilson  <cygwin@cwilson.fastmail.fm>
  
***************
*** 11312,11331 ****
  
  	* lib/findprog.c (find_in_path): Avoid "gcc -Wwrite-strings" warning.
  
- 2006-10-19  Paul Eggert  <eggert@cs.ucla.edu>
- 
- 	* lib/xstrtol.h: Include gettext.h.
- 	(_STRTOL_ERROR): Wrap English-language formats inside gettext.
- 	Problem reported by Eric Blake.
- 	* modules/xstrtol (Depends-on): Add gettext-h.
- 
- 2006-10-19  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
- 
- 	* lib/strftime.c (advance): New macro.
- 	(add): Use it to avoid adding 0 to a FILE *.  FILE can be an
- 	incomplete type, so you can't add 0 to it.  Problem and patch
- 	reported by Eelco Dolstra for dietlibc.
- 
  2006-10-18  Jim Meyering  <jim@meyering.net>
  
  	* lib/readutmp.c (desirable_utmp_entry): Use "bool" as the
--- 11320,11325 ----
***************
*** 11357,11362 ****
--- 11351,11365 ----
  	* lib/gettext.h (gettext, ngettext, pgettext, npgettext): Define
  	differently if DEFAULT_TEXT_DOMAIN is set.
  
+ 2006-10-17  Eric Blake  <ebb9@byu.net>
+ 
+ 	* lib/xvasprintf.c (includes): Assume config.h.
+ 	* lib/xasprintf.c (includes): Likewise.
+ 
+ 2006-10-16  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* lib/c-strstr.c: Include c-strstr.h.
+ 
  2006-10-16  Bruno Haible  <bruno@clisp.org>
  
  	* lib/clean-temp.c: Include fwriteerror.h.
***************
*** 11371,11381 ****
  	* lib/sigprocmask.h: Include <sys/types.h>.
  	(sigset_t): Use the system's definition if present.
  
- 2006-10-17  Eric Blake  <ebb9@byu.net>
- 
- 	* lib/xvasprintf.c (includes): Assume config.h.
- 	* lib/xasprintf.c (includes): Likewise.
- 
  2006-10-16  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* lib/fsusage.c (PROPAGATE_ALL_ONES): Don't assume uintmax_t is
--- 11374,11379 ----
***************
*** 11870,11902 ****
  	(_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX): Handle
  	MSVC and mingw explicitly.
  
- 2006-10-11  Simon Josefsson  <jas@extundo.com>
- 	    Bruno Haible  <bruno@clisp.org>
- 
- 	Add support for multiple gnulib-tool invocations in the scope of a
- 	single configure.ac file.
- 	* gnulib-tool (func_emit_lib_Makefile_am): In the _LIBADD variable,
- 	use a private [LT]LIBOBJS variant. Define a _DEPENDENCIES variable
- 	with the same contents as the _LIBADD variable.
- 	(func_emit_initmacro_start, func_emit_initmacro_end,
- 	func_emit_initmacro_done): New functions.
- 	(func_import, func_create_testdir): Invoke them. Allow the identifiers
- 	gl_LIBOBJS and gl_LTLIBOBJS.
- 
- 2006-10-11  Bruno Haible  <bruno@clisp.org>
- 
- 	* gnulib-tool (GETTEXTPATH, AUTOHEADER, AUTOPOINT): New variables.
- 	(func_create_testdir): Don't create po/Makefile.am, don't invoke
- 	autoreconf. Instead, invoke autopoint explicitly but move back the
- 	*.m4 files from gnulib.
- 
- 2006-10-11  Bruno Haible  <bruno@clisp.org>
- 
- 	* gnulib-tool (func_usage): Make module names after --create-testdir
- 	optional.
- 	(func_create_testdir): If no module was specified, use nearly all
- 	modules.
- 
  2006-10-12  Jim Meyering  <jim@meyering.net>
  
  	Big performance improvement for fts-based tools that use FTS_NOSTAT.
--- 11868,11873 ----
***************
*** 11935,11940 ****
--- 11906,11938 ----
  	* m4/rename-dest-slash.m4 (gl_FUNC_RENAME_TRAILING_DEST_SLASH):
  	Fix misspelling in diagnostic.
  
+ 2006-10-11  Simon Josefsson  <jas@extundo.com>
+ 	    Bruno Haible  <bruno@clisp.org>
+ 
+ 	Add support for multiple gnulib-tool invocations in the scope of a
+ 	single configure.ac file.
+ 	* gnulib-tool (func_emit_lib_Makefile_am): In the _LIBADD variable,
+ 	use a private [LT]LIBOBJS variant. Define a _DEPENDENCIES variable
+ 	with the same contents as the _LIBADD variable.
+ 	(func_emit_initmacro_start, func_emit_initmacro_end,
+ 	func_emit_initmacro_done): New functions.
+ 	(func_import, func_create_testdir): Invoke them. Allow the identifiers
+ 	gl_LIBOBJS and gl_LTLIBOBJS.
+ 
+ 2006-10-11  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* gnulib-tool (GETTEXTPATH, AUTOHEADER, AUTOPOINT): New variables.
+ 	(func_create_testdir): Don't create po/Makefile.am, don't invoke
+ 	autoreconf. Instead, invoke autopoint explicitly but move back the
+ 	*.m4 files from gnulib.
+ 
+ 2006-10-11  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* gnulib-tool (func_usage): Make module names after --create-testdir
+ 	optional.
+ 	(func_create_testdir): If no module was specified, use nearly all
+ 	modules.
+ 
  2006-10-11  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* lib/mkdir-p.c (HAVE_FCHMOD): Define to false if not already
***************
*** 13593,13598 ****
--- 13591,13601 ----
  	* MODULES.html.sh (Compatibility checks for POSIX:2001 functions: Fix
  	HTML structure.
  
+ 2006-08-24  Bruno Haible  <bruno@clisp.org>
+ 
+ 	* MODULES.html.sh (Compatibility checks for POSIX:2001 functions): Fix
+ 	HTML structure.
+ 
  2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
  
  	* modules/openat (Depends-on): Add lchown.
***************
*** 18765,18770 ****
--- 18768,18775 ----
  	* modules/strchrnul (License): Likewise.
  	* modules/sysexits (License): Likewise.
  
+ 2005-10-08  Martin Lambers  <marlam@marlam.de>
+ 2005-10-08  Paul Eggert  <eggert@cs.ucla.edu>
  2005-10-08  Simon Josefsson  <jas@extundo.com>
  
  	* config/srclist.txt: Bug 1423 is closed, but 1439 remains.
***************
*** 34640,34646 ****
  	* m4/uintmax_t.m4: New file.
  	* m4/Makefile.am (EXTRA_DIST): Add inttypes_h.m4 and uintmax_t.m4.
  
! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
  Copying and distribution of this file, with or without modification,
  are permitted provided the copyright notice and this notice are preserved.
--- 34645,34651 ----
  	* m4/uintmax_t.m4: New file.
  	* m4/Makefile.am (EXTRA_DIST): Add inttypes_h.m4 and uintmax_t.m4.
  
! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
  Copying and distribution of this file, with or without modification,
  are permitted provided the copyright notice and this notice are preserved.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: git: avoiding merges, rebasing
  2007-10-09 10:43         ` Johannes Schindelin
@ 2007-10-09 18:06           ` Benoit SIGOURE
  0 siblings, 0 replies; 15+ messages in thread
From: Benoit SIGOURE @ 2007-10-09 18:06 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git list

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

On Oct 9, 2007, at 12:43 PM, Johannes Schindelin wrote:

> Hi,
>
> On Mon, 8 Oct 2007, Benoit SIGOURE wrote:
>
>> [as usual, I forgot the attachment...]
>
> Two comments:
>
> - by not inlining you made it hard to review your script.  Therefore I
>   will not do it.

:|

>
> - Try to avoid naming the script git-merge-*; these scripts/ 
> programs are
>   merge _strategies_, not merge _drivers_ (and yes, we already have  
> two
>   programs violating this rule -- merge-base and merge-file -- but  
> that
>   does not mean that you are free to add to the pile).

I'm open to better suggestions.

Cheers,

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* GNU-style ChangeLog merge driver for Git (was: Re: git: avoiding merges, rebasing)
  2007-10-09 12:03         ` Bruno Haible
@ 2007-10-09 18:19           ` Benoit SIGOURE
  2007-10-09 19:38             ` GNU-style ChangeLog merge driver for Git Bruno Haible
  0 siblings, 1 reply; 15+ messages in thread
From: Benoit SIGOURE @ 2007-10-09 18:19 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib, git list

[-- Attachment #1: Type: text/plain, Size: 3366 bytes --]

On Oct 9, 2007, at 2:03 PM, Bruno Haible wrote:

> Hello Benoit,
>
> Thanks for working on this. But this merge driver has a few major  
> nits.
>
>
> 1) While my ChangeLog file was locally unmodified but some pulled  
> in commits
>    should modify it, "git pull" stopped and said:
>
> ChangeLog: needs update
> fatal: Entry 'ChangeLog' not uptodate. Cannot merge.
>
> [I cannot swear on this, because I did not do a "git status" before  
> the
> "git pull", but this is in a directory where I usually have no  
> pending diffs.]

I'll check but I'm afraid that Git bails out before actually trying  
the merge driver.

>
> The ChangeLog in question is the one from gnulib
> (git clone git://git.sv.gnu.org/gnulib).
>
>
> 2) This "merge driver" did much more than sorting in a merge: it  
> sorted the
> entire file! In doing so,
>   - It changed the order of ChangeLog entries in a way that does  
> not represent
>     the historical commit order.
>   - For ChangeLog entries with multiple contributors, it shuffled  
> around these
>     extra contributors to other ChangeLog entries.
>   - Near the end of the file, it made a change that I cannot explain.
>
> Find attached a context diff of all the bad changes that it did.
>

Yes, it's pretty stupid, I hacked this in a hurry.  I'll try to  
improve it so that it doesn't have these undesired side-effects.

>
> In my opinion, a merge driver should not do changes to the file except
> in the range of lines where the conflict occurred. For a ChangeLog  
> driver,
> all uncommitted entries should be collected at the top of the file,  
> because
> 1. ChangeLogs are kept in the order of historical commit in the  
> central
>    repository,
> 2. other developers always look at the top of the ChangeLog; if a  
> ChangeLog
>    entries is inserted second or third after some already present  
> entries,
>    the danger is too high that the change gets unnoticed.
>
> So "git-merge-changelog OLD CURRENT OTHERS" should IMO do the  
> following:
> 1) Collect the changes between OLD and HEAD (I don't know if that  
> is CURRENT
>    or OTHERS?), in two categories:
>      - added entries,
>      - changed and removed entries.
> 2) Back out the added entries, keeping only the changed and removed  
> entries
>    as modifications.
> 3) Do a normal merge between this and the pulled in remote branch  
> (I don't
>    know if that is OTHERS or CURRENT?). If that merge gives a  
> conflict,
>    bail out.
> 4) Insert the added entries at the top, in the same order as they were
>    originally (no sorting).
>
> Bruno
> <git-merge-changelog-blunder>

OK I'll try to rework the driver so that it implements this.  It will  
take some time though, I'm quite busy these days.
Akim Demaille would also like it to squash the commits added by the  
merge (the new commits in OTHERS):

YYYY-MM-DD  Author  <who@where.com>

	Merge whatever:

	YYYY-MM-DD  Someone Else  <foo@bar.com>
	Some change.
	* FileChanged.c: Whatever.

	YYYY-MM-DD  Who Cares  <who@cares.com>
	Some other change.
	* OtherFile.c: Do it.

I thought this was mandated by the GNU Coding Standards but I  
checked, it doesn't say anything about merges.  Would this sort of  
strategy be useful to you?  Should it be default (or enabled by some  
--squash option)?

Cheers,

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: GNU-style ChangeLog merge driver for Git
  2007-10-09 18:19           ` GNU-style ChangeLog merge driver for Git (was: Re: git: avoiding merges, rebasing) Benoit SIGOURE
@ 2007-10-09 19:38             ` Bruno Haible
  0 siblings, 0 replies; 15+ messages in thread
From: Bruno Haible @ 2007-10-09 19:38 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: bug-gnulib, git list

Hello Benoit,

> Akim Demaille would also like it to squash the commits added by the  
> merge (the new commits in OTHERS):
> 
> YYYY-MM-DD  Author  <who@where.com>
> 
> 	Merge whatever:
> 
> 	YYYY-MM-DD  Someone Else  <foo@bar.com>
> 	Some change.
> 	* FileChanged.c: Whatever.
> 
> 	YYYY-MM-DD  Who Cares  <who@cares.com>
> 	Some other change.
> 	* OtherFile.c: Do it.
> 
> I thought this was mandated by the GNU Coding Standards but I  
> checked, it doesn't say anything about merges.  Would this sort of  
> strategy be useful to you?  Should it be default (or enabled by some  
> --squash option)?

This merge is occurring in a different situation:

The situation where we need ChangeLog merging most often is when a developer
has made changes on his own and pulls in the changes from the remote repository
(via "git stash; git pull; git stash apply").

The situation that Akim is describing is that he pulls changes from the
repository of Someone Else and Who Cares, and then pushes them into the
central repository, under his responsibility.

For the first situation, the non-remote ChangeLog entries should be moved
to the top, without modification or indentation.

For the second situation, three different styles are in use at GNU
(because they don't use "Signed-off" lines):

1) unmodified copying of the ChangeLog entries:

YYYY-MM-DD  Someone Else  <foo@bar.com>
	Some change.
	* FileChanged.c: Whatever.

YYYY-MM-DD  Who Cares  <who@cares.com>
	Some other change.
	* OtherFile.c: Do it.

2) copying with lieutenant's email address, like Akim described it:

YYYY-MM-DD  Lieu Tenant  <who@where.com>

	YYYY-MM-DD  Someone Else  <foo@bar.com>
	Some change.
	* FileChanged.c: Whatever.

	YYYY-MM-DD  Who Cares  <who@cares.com>
	Some other change.
	* OtherFile.c: Do it.

3) similar, but with indentation of the entire copied-in ChangeLog entries:

YYYY-MM-DD  Lieu Tenant  <who@where.com>

	YYYY-MM-DD  Someone Else  <foo@bar.com>
		Some change.
		* FileChanged.c: Whatever.

	YYYY-MM-DD  Who Cares  <who@cares.com>
		Some other change.
		* OtherFile.c: Do it.

First of all, your merge driver could try to guess whether we're in the
first or second situation (maybe by testing whether the names in the
ChangeLog entry match the [user]name from the git config).

Then, for the second situation, there can be some flag in the driver or in
the git config that describes which of the 3 styles to apply.

Bruno

^ permalink raw reply	[flat|nested] 15+ messages in thread

* stash clear, was Re: git: avoiding merges, rebasing
  2007-10-02 12:16       ` git: avoiding merges, rebasing Eric Blake
  2007-10-03 21:31         ` making "git stash" safer to use Bruno Haible
@ 2007-10-19 13:37         ` Johannes Schindelin
  2007-10-23  8:55           ` Miles Bader
  1 sibling, 1 reply; 15+ messages in thread
From: Johannes Schindelin @ 2007-10-19 13:37 UTC (permalink / raw)
  To: Eric Blake; +Cc: bug-gnulib, Bruno Haible, git

Hi,

On Tue, 2 Oct 2007, Eric Blake wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> [adding the git list]
> 
> According to Bruno Haible on 10/2/2007 5:50 AM:
> > Hello Benoit,
> > 
> >>>     $ git stash
> >>>     $ git pull
> >>>     $ git stash apply
> >>>     $ git stash clean              ; typo!
> >>>     $ git stash clear              ; fatal correction to typo!
> >>>
> >>> and lost 20 modified files. Well, not really lost. Just took me a  
> >>> while to
> >> I don't really see how and why you "lost 20 modified files".
> > 
> > I lost modifications to 20 files. "git stash clean" moved these modifications
> > into a stash named "clean", and "git stash clear" killed it.
> 
> While we're at it, I wish 'git stash clear' would take an optional 
> argument that says which stash(es) to clear, rather than blindly 
> clearing the entire stash.

I'd rather avoid "enhancing" stash clear.  IMHO it is a little 
misdesigned, making it way too easy to hang yourself.

Instead, how about writing a stash pop?  "git stash pop [<stash>]".  It 
would literally just call git stash apply && git reflog delete.  Should 
not be too difficult, now that I provided "git reflog delete" ;-)

Maybe even deprecating "git stash clear", or doing away with it 
altogether.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: stash clear, was Re: git: avoiding merges, rebasing
  2007-10-19 13:37         ` stash clear, was Re: git: avoiding merges, rebasing Johannes Schindelin
@ 2007-10-23  8:55           ` Miles Bader
  0 siblings, 0 replies; 15+ messages in thread
From: Miles Bader @ 2007-10-23  8:55 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Eric Blake, bug-gnulib, Bruno Haible, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Instead, how about writing a stash pop?  "git stash pop [<stash>]".  It 
> would literally just call git stash apply && git reflog delete.  Should 
> not be too difficult, now that I provided "git reflog delete" ;-)
>
> Maybe even deprecating "git stash clear", or doing away with it 
> altogether.

That would match my usual usage well.

Actually, I really like the way the tla (arch) "undo" and "redo"
commands work:  "tla undo" is roughly equivalent to "git stash", but by
default chooses a name with an appended integer which is one greater
than the greatest existing "stash" (to use git terminology).  "tla redo"
by default applies the last saved value and deletes it.  So basically
push and pop.  Usually, of course, you only use one level, but on the
occasions when you want more, it feels very natural.

I dunno how this would work with stash, but push/pop functionality would
be good...

-Miles

-- 
Saa, shall we dance?  (from a dance-class advertisement)

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-10-23  8:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200709301421.52192.bruno@clisp.org>
     [not found] ` <200710020347.43733.bruno@clisp.org>
     [not found]   ` <4AD64749-F4A3-4A61-B1EE-D12523293661@lrde.epita.fr>
     [not found]     ` <200710021350.54625.bruno@clisp.org>
2007-10-02 12:16       ` git: avoiding merges, rebasing Eric Blake
2007-10-03 21:31         ` making "git stash" safer to use Bruno Haible
2007-10-03 21:36           ` Junio C Hamano
2007-10-04  8:40           ` Joachim B Haga
2007-10-04 20:59             ` David Kastrup
2007-10-19 13:37         ` stash clear, was Re: git: avoiding merges, rebasing Johannes Schindelin
2007-10-23  8:55           ` Miles Bader
     [not found]       ` <6C9F1445-8826-4E6F-A10C-290A57A4C826@lrde.epita.fr>
2007-10-03 23:01         ` Bruno Haible
     [not found] ` <46FF99E2.8050605@byu.net>
     [not found]   ` <200709302141.25597.bruno@clisp.org>
     [not found]     ` <C64152A3-A5A6-4320-864C-E78E3A60C8E6@lrde.epita.fr>
2007-10-08 13:16       ` Benoit SIGOURE
2007-10-08 13:17       ` Benoit SIGOURE
2007-10-09 10:43         ` Johannes Schindelin
2007-10-09 18:06           ` Benoit SIGOURE
2007-10-09 12:03         ` Bruno Haible
2007-10-09 18:19           ` GNU-style ChangeLog merge driver for Git (was: Re: git: avoiding merges, rebasing) Benoit SIGOURE
2007-10-09 19:38             ` GNU-style ChangeLog merge driver for Git Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).