Code

git.git
15 years agoUse die_errno() instead of die() when checking syscalls
Thomas Rast [Sat, 27 Jun 2009 15:58:47 +0000 (17:58 +0200)]
Use die_errno() instead of die() when checking syscalls

Lots of die() calls did not actually report the kind of error, which
can leave the user confused as to the real problem.  Use die_errno()
where we check a system/library call that sets errno on failure, or
one of the following that wrap such calls:

  Function              Passes on error from
  --------              --------------------
  odb_pack_keep         open
  read_ancestry         fopen
  read_in_full          xread
  strbuf_read           xread
  strbuf_read_file      open or strbuf_read_file
  strbuf_readlink       readlink
  write_in_full         xwrite

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoConvert existing die(..., strerror(errno)) to die_errno()
Thomas Rast [Sat, 27 Jun 2009 15:58:46 +0000 (17:58 +0200)]
Convert existing die(..., strerror(errno)) to die_errno()

Change calls to die(..., strerror(errno)) to use the new die_errno().

In the process, also make slight style adjustments: at least state
_something_ about the function that failed (instead of just printing
the pathname), and put paths in single quotes.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodie_errno(): double % in strerror() output just in case
Junio C Hamano [Sat, 27 Jun 2009 15:58:45 +0000 (17:58 +0200)]
die_errno(): double % in strerror() output just in case

[tr: handle border case where % is placed at end of buffer]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoIntroduce die_errno() that appends strerror(errno) to die()
Thomas Rast [Sat, 27 Jun 2009 15:58:44 +0000 (17:58 +0200)]
Introduce die_errno() that appends strerror(errno) to die()

There are many calls to die() that do, or should, report
strerror(errno) to indicate how the syscall they guard failed.
Introduce a small helper function for this case.

Note:

- POSIX says vsnprintf can modify errno in some unlikely cases, so we
  have to use errno early.

- We take some care to pass the original format to die_routine(), in
  case someone wants to call die_errno() with custom format
  characters.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: test-parse-options depends on parse-options.h
Junio C Hamano [Sun, 7 Jun 2009 08:34:51 +0000 (01:34 -0700)]
Makefile: test-parse-options depends on parse-options.h

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 7 Jun 2009 06:49:28 +0000 (23:49 -0700)]
Merge branch 'maint'

* maint:
  Documentation: refer to gitworkflows(7) from tutorial and git(1)
  daemon: Strictly parse the "extra arg" part of the command

15 years agoDocumentation: refer to gitworkflows(7) from tutorial and git(1)
Thomas Rast [Sat, 6 Jun 2009 13:11:07 +0000 (15:11 +0200)]
Documentation: refer to gitworkflows(7) from tutorial and git(1)

Add references to the gitworkflows(7) manpage added in f948dd8
(Documentation: add manpage about workflows, 2008-10-19) to both
gittutorial(1) and git(1), so that new users might actually discover
and read it.

Noticed by Randal L. Schwartz.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodaemon: Strictly parse the "extra arg" part of the command
Shawn O. Pearce [Fri, 5 Jun 2009 01:33:32 +0000 (18:33 -0700)]
daemon: Strictly parse the "extra arg" part of the command

Since 1.4.4.5 (49ba83fb67 "Add virtualization support to git-daemon")
git daemon enters an infinite loop and never terminates if a client
hides any extra arguments in the initial request line which is not
exactly "\0host=blah\0".

Since that change, a client must never insert additional extra
arguments, or attempt to use any argument other than "host=", as
any daemon will get stuck parsing the request line and will never
complete the request.

Since the client can't tell if the daemon is patched or not, it
is not possible to know if additional extra args might actually be
able to be safely requested.

If we ever need to extend the git daemon protocol to support a new
feature, we may have to do something like this to the exchange:

  # If both support git:// v2
  #
  C: 000cgit://v2
  S: 0010ok host user
  C: 0018host git.kernel.org
  C: 0027git-upload-pack /pub/linux-2.6.git
  S: ...git-upload-pack header...

  # If client supports git:// v2, server does not:
  #
  C: 000cgit://v2
  S: <EOF>

  C: 003bgit-upload-pack /pub/linux-2.6.git\0host=git.kernel.org\0
  S: ...git-upload-pack header...

This requires the client to create two TCP connections to talk to
an older git daemon, however all daemons since the introduction of
daemon.c will safely reject the unknown "git://v2" command request,
so the client can quite easily determine the server supports an
older protocol.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation/git.txt: update links to release notes
Junio C Hamano [Thu, 4 Jun 2009 05:52:37 +0000 (22:52 -0700)]
Documentation/git.txt: update links to release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint' to sync with 1.6.3.2
Junio C Hamano [Thu, 4 Jun 2009 05:51:56 +0000 (22:51 -0700)]
Merge branch 'maint' to sync with 1.6.3.2

15 years agoGIT 1.6.3.2 v1.6.3.2
Junio C Hamano [Thu, 4 Jun 2009 05:42:15 +0000 (22:42 -0700)]
GIT 1.6.3.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoShow presence of stashed changes in bash prompt.
Daniel Trstenjak [Tue, 2 Jun 2009 18:03:22 +0000 (20:03 +0200)]
Show presence of stashed changes in bash prompt.

Add a '$' in the __git_ps1 output to show stashed changes are present,
when GIT_PS1_SHOWSTASHSTATE is set to a nonempty value.

The code for checking if the stash has entries is taken from
'git-stash.sh'.

Signed-off-by: Daniel Trstenjak <daniel.trstenjak@online.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: fix empty word-regexp matches
René Scharfe [Wed, 3 Jun 2009 16:19:01 +0000 (18:19 +0200)]
grep: fix empty word-regexp matches

The command "git grep -w ''" dies as soon as it encounters an empty line,
reporting (wrongly) that "regexp returned nonsense".  The first hunk of
this patch relaxes the sanity check that is responsible for that,
allowing matches to start at the end.

The second hunk complements it by making sure that empty matches are
rejected if -w was specified, as they are not really words.

GNU grep does the same:

$ echo foo | grep -c ''
1
$ echo foo | grep -c -w ''
0

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'da/pretty-tempname'
Junio C Hamano [Wed, 3 Jun 2009 07:50:05 +0000 (00:50 -0700)]
Merge branch 'da/pretty-tempname'

* da/pretty-tempname:
  diff: generate pretty filenames in prep_temp_blob()
  compat: add a basename() compatibility function
  compat: add a mkstemps() compatibility function

Conflicts:
Makefile

15 years agoClean up and simplify rev_compare_tree()
Linus Torvalds [Wed, 3 Jun 2009 01:34:01 +0000 (18:34 -0700)]
Clean up and simplify rev_compare_tree()

This simplifies the logic of rev_compare_tree() by removing a special
case.

It does so by turning the special case of finding a diff to be "all new
files" into a more generic case of "all new" vs "all removed" vs "mixed
changes", so now the code is actually more powerful and more generic, and
the added symmetry actually makes it simpler too.

This makes no changes to any existing behavior, but apart from the
simplification it does make it possible to some day care about whether all
changes were just deletions if we want to. Which we may well want to for
merge handling.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 3 Jun 2009 07:49:40 +0000 (00:49 -0700)]
Merge branch 'maint'

* maint:
  blame: correctly handle a path that used to be a directory
  add -i: do not dump patch during application
  Update draft release notes for 1.6.3.2
  grep: fix colouring of matches with zero length
  Documentation: teach stash/pop workflow instead of stash/apply
  Change xdl_merge to generate output even for null merges
  t6023: merge-file fails to output anything for a degenerate merge

15 years agoblame: correctly handle a path that used to be a directory
Junio C Hamano [Wed, 3 Jun 2009 07:43:22 +0000 (00:43 -0700)]
blame: correctly handle a path that used to be a directory

When trying to see if the same path exists in the parent, we ran
"diff-tree" with pathspec set to the path we are interested in with the
parent, and expect either to have exactly one resulting filepair (either
"changed from the parent", "created when there was none") or nothing (when
there is no change from the parent).

If the path used to be a directory, however, we will also see unbounded
number of entries that talk about the files that used to exist underneath
the directory in question.  Correctly pick only the entry that describes
the path we are interested in in such a case (namely, the creation of the
path as a regular file).

Noticed by Ben Willard.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoadd -i: do not dump patch during application
Thomas Rast [Tue, 2 Jun 2009 21:34:27 +0000 (23:34 +0200)]
add -i: do not dump patch during application

Remove a debugging print that snuck in at 7a26e65 (Revert
"git-add--interactive: remove hunk coalescing", 2009-05-16).

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes for 1.6.3.2
Junio C Hamano [Tue, 2 Jun 2009 14:57:39 +0000 (07:57 -0700)]
Update draft release notes for 1.6.3.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'cb/maint-1.6.0-xdl-merge-fix' into maint
Junio C Hamano [Tue, 2 Jun 2009 14:48:44 +0000 (07:48 -0700)]
Merge branch 'cb/maint-1.6.0-xdl-merge-fix' into maint

* cb/maint-1.6.0-xdl-merge-fix:
  Change xdl_merge to generate output even for null merges
  t6023: merge-file fails to output anything for a degenerate merge

Conflicts:
xdiff/xmerge.c

15 years agoMerge branch 'rs/maint-grep-word-regexp-fix' into maint
Junio C Hamano [Tue, 2 Jun 2009 14:48:09 +0000 (07:48 -0700)]
Merge branch 'rs/maint-grep-word-regexp-fix' into maint

* rs/maint-grep-word-regexp-fix:
  grep: fix colouring of matches with zero length
  grep: fix word-regexp at the beginning of lines

15 years agoMerge branch 'sb/maint-1.6.2-opt-filename-fix' into maint
Junio C Hamano [Tue, 2 Jun 2009 14:47:03 +0000 (07:47 -0700)]
Merge branch 'sb/maint-1.6.2-opt-filename-fix' into maint

* sb/maint-1.6.2-opt-filename-fix:
  apply, fmt-merge-msg: use relative filenames
  commit: -F overrides -t

15 years agoMerge branch 'jc/maint-add-p-coalesce-fix' into maint
Junio C Hamano [Tue, 2 Jun 2009 14:46:52 +0000 (07:46 -0700)]
Merge branch 'jc/maint-add-p-coalesce-fix' into maint

* jc/maint-add-p-coalesce-fix:
  t3701: ensure correctly set up repository after skipped tests
  Revert "git-add--interactive: remove hunk coalescing"
  Splitting a hunk that adds a line at the top fails in "add -p"

15 years agoMerge branch 'tr/maint-doc-stash-pop' into maint
Junio C Hamano [Tue, 2 Jun 2009 14:43:45 +0000 (07:43 -0700)]
Merge branch 'tr/maint-doc-stash-pop' into maint

* tr/maint-doc-stash-pop:
  Documentation: teach stash/pop workflow instead of stash/apply

15 years agotest-lib: fix http exit codes
Clemens Buchacher [Mon, 1 Jun 2009 12:28:25 +0000 (14:28 +0200)]
test-lib: fix http exit codes

Previously, die() would report the exit code of stop_httpd. Instead,
save and reset the exit code before dying.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotest-lib: allow exit trap to be used for cleanup by tests
Clemens Buchacher [Mon, 1 Jun 2009 12:14:41 +0000 (14:14 +0200)]
test-lib: allow exit trap to be used for cleanup by tests

Exit trap should not be removed in case tests require cleanup code. This
is especially important if tests are executed with the --immediate option.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotest-lib: fail if invalid options are passed
Clemens Buchacher [Mon, 1 Jun 2009 12:14:40 +0000 (14:14 +0200)]
test-lib: fail if invalid options are passed

Previously, unknown options would be ignored, including any subsequent
valid options.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: fix colouring of matches with zero length
René Scharfe [Mon, 1 Jun 2009 21:53:05 +0000 (23:53 +0200)]
grep: fix colouring of matches with zero length

If a zero-length match is encountered, break out of loop and show the rest
of the line uncoloured.  Otherwise we'd be looping forever, trying to make
progress by advancing the pointer by zero characters.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-show-branch.txt: document --date-order option
Stephen Boyd [Mon, 1 Jun 2009 06:34:46 +0000 (23:34 -0700)]
git-show-branch.txt: document --date-order option

Copy the description of date-order from rev-list-options.txt, and then
reword it to be commit specific. While we're at it, put <rev> <glob>...
on a new line to not exceed 80 characters.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff: generate pretty filenames in prep_temp_blob()
David Aguilar [Sun, 31 May 2009 08:35:52 +0000 (01:35 -0700)]
diff: generate pretty filenames in prep_temp_blob()

Naturally, prep_temp_blob() did not care about filenames.
As a result, GIT_EXTERNAL_DIFF and textconv generated
filenames such as ".diff_XXXXXX".

This modifies prep_temp_blob() to generate user-friendly
filenames when creating temporary files.

Diffing "name.ext" now generates "XXXXXX_name.ext".

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompat: add a basename() compatibility function
David Aguilar [Sun, 31 May 2009 08:35:51 +0000 (01:35 -0700)]
compat: add a basename() compatibility function

Some systems such as Windows lack libgen.h so provide a
basename() implementation for cross-platform use.

This introduces the NO_LIBGEN_H construct to the Makefile
and autoconf scripts.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompat: add a mkstemps() compatibility function
David Aguilar [Sun, 31 May 2009 08:35:50 +0000 (01:35 -0700)]
compat: add a mkstemps() compatibility function

mkstemps() is a BSD extension so provide an implementation
for cross-platform use.

Signed-off-by: David Aguilar <davvid@gmail.com>
Tested-by: Johannes Sixt <j6t@kdbg.org> (Windows)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'sb/opt-filename'
Junio C Hamano [Sun, 31 May 2009 23:57:42 +0000 (16:57 -0700)]
Merge branch 'sb/opt-filename'

* sb/opt-filename:
  parse-opts: add OPT_FILENAME and transition builtins
  parse-opts: prepare for OPT_FILENAME

Conflicts:
builtin-log.c

15 years agoMerge branch 'jc/solaris-0811'
Junio C Hamano [Sun, 31 May 2009 23:18:02 +0000 (16:18 -0700)]
Merge branch 'jc/solaris-0811'

* jc/solaris-0811:
  OpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV
  Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6

15 years agoMerge branch 'sb/show-branch-parse-options'
Junio C Hamano [Sun, 31 May 2009 23:17:58 +0000 (16:17 -0700)]
Merge branch 'sb/show-branch-parse-options'

* sb/show-branch-parse-options:
  show-branch: migrate to parse-options API
  parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's

Conflicts:
parse-options.h

15 years agoMerge branch 'mm/apply-double-slash'
Junio C Hamano [Sun, 31 May 2009 23:17:46 +0000 (16:17 -0700)]
Merge branch 'mm/apply-double-slash'

* mm/apply-double-slash:
  apply: handle filenames with double slashes better

15 years agoMerge branch 'sb/format-patch-parseopt'
Junio C Hamano [Sun, 31 May 2009 23:17:31 +0000 (16:17 -0700)]
Merge branch 'sb/format-patch-parseopt'

* sb/format-patch-parseopt:
  format-patch: migrate to parse-options API

Conflicts:
builtin-log.c

15 years agoMerge branch 'jc/mktree'
Junio C Hamano [Sun, 31 May 2009 23:17:11 +0000 (16:17 -0700)]
Merge branch 'jc/mktree'

* jc/mktree:
  mktree: validate entry type in input
  mktree --batch: build more than one tree object
  mktree --missing: updated usage message and man page
  mktree --missing: allow missing objects
  t1010: add mktree test
  mktree: do not barf on a submodule commit
  builtin-mktree.c: use a helper function to handle one line of input
  mktree: use parse-options
  build-in git-mktree

15 years agoMerge branch 'ew/svn-test-and-old-i18n'
Junio C Hamano [Sun, 31 May 2009 23:17:07 +0000 (16:17 -0700)]
Merge branch 'ew/svn-test-and-old-i18n'

* ew/svn-test-and-old-i18n:
  t8005: fix typo, it's ISO-8859-5, not KOI8-R
  t8005: convert CP1251 character set to ISO8859-5
  t8005: use more portable character encoding names
  t5100: use ancient encoding syntax for backwards compatibility
  t9301: use ISO8859-1 rather than ISO-8859-1
  t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility
  t3901: avoid negation on right hand side of '|'
  builtin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback encoding
  builtin-mailinfo.c: compare character encodings case insensitively
  Use 'UTF-8' rather than 'utf-8' everywhere for backward compatibility
  t3900: use ancient iconv names for backward compatibility

15 years agoMerge branch 'mw/send-email'
Junio C Hamano [Sun, 31 May 2009 23:16:52 +0000 (16:16 -0700)]
Merge branch 'mw/send-email'

* mw/send-email:
  send-email: Remove superfluous `my $editor = ...'
  send-email: 'References:' should only reference what is sent
  send-email: Handle "GIT:" rather than "GIT: " during --compose
  Docs: send-email: --smtp-server-port can take symbolic ports
  Docs: send-email: Refer to CONFIGURATION section for sendemail.multiedit
  Docs: send-email: Put options back into alphabetical order

15 years agoMerge branch 'cc/bisect' (early part)
Junio C Hamano [Sun, 31 May 2009 23:16:48 +0000 (16:16 -0700)]
Merge branch 'cc/bisect' (early part)

* 'cc/bisect' (early part):
  bisect: check ancestors without forking a "git rev-list" process
  commit: add function to unparse a commit and its parents
  bisect: rework some rev related functions to make them more reusable

15 years agogit-add: no need for -f when resolving a conflict in already tracked path
Jeff King [Sat, 30 May 2009 21:54:18 +0000 (17:54 -0400)]
git-add: no need for -f when resolving a conflict in already tracked path

When a path F that matches ignore pattern has a conflict, "git add F"
insisted the -f option be given, which did not make sense.  It would have
required -f when the path was originally added, but when resolving a
conflict, it already is tracked.

So this should work (and does):

  $ echo file >.gitignore
  $ echo content >file
  $ git add -f file ;# need -f because we are adding new path
  $ echo more content >>file
  $ git add file ;# don't need -f; it is not actually an "other" file

This is handled under the hood by the COLLECT_IGNORED option to
read_directory. When that code finds an ignored file, it checks the
index to make sure it is not actually a tracked file. However, the test
it uses does not take into account unmerged entries, and considers them
to still be ignored. "git ls-files" uses a more elaborate test and gets
the right answer and the same test should be used here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconfig.txt: document add.ignore-errors
Stephen Boyd [Sun, 31 May 2009 05:08:02 +0000 (22:08 -0700)]
config.txt: document add.ignore-errors

Use the description of "--ignore-errors" from git-add.txt as
inspiration.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: remove always true if statement from __git_ps1()
SZEDER Gábor [Fri, 29 May 2009 12:00:36 +0000 (14:00 +0200)]
bash: remove always true if statement from __git_ps1()

The recent commits 8763dbb1 (completion: fix PS1 display during a
merge on detached HEAD, 2009-05-16), ff790b6a (completion: simplify
"current branch" in __git_ps1(), 2009-05-10), and d7107ca6
(completion: fix PS1 display during an AM on detached HEAD,
2009-05-26) ensure that the branch name in __git_ps1() is always set
to something sensible.  Therefore, the condition for checking the
non-empty branch name is always fulfilled, and can be removed.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-apply(1): Clarify that one can select where to apply the patch
Björn Steinbrink [Fri, 29 May 2009 10:21:24 +0000 (12:21 +0200)]
git-apply(1): Clarify that one can select where to apply the patch

The patch can be applied to the work tree, the index or both, but the
short description made it look like it's always applied to both.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohttp-push: reuse existing is_null_ref
Clemens Buchacher [Sun, 31 May 2009 10:36:10 +0000 (12:36 +0200)]
http-push: reuse existing is_null_ref

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot9139 uses ancient, backwards-compatible iconv names
Eric Wong [Sat, 30 May 2009 00:14:47 +0000 (17:14 -0700)]
t9139 uses ancient, backwards-compatible iconv names

This resolves a semantic conflicts early to work with 5ae93df (t3900: use
ancient iconv names for backward compatibility, 2009-05-18).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Sun, 31 May 2009 05:25:41 +0000 (22:25 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: refuse to dcommit non-UTF-8 messages

15 years agoDocumentation: teach stash/pop workflow instead of stash/apply
Thomas Rast [Thu, 28 May 2009 09:40:15 +0000 (11:40 +0200)]
Documentation: teach stash/pop workflow instead of stash/apply

Recent discussion on the list showed some comments in favour of a
stash/pop workflow:

  http://marc.info/?l=git&m=124234911423358&w=2
  http://marc.info/?l=git&m=124235348327711&w=2

Change the stash documentation and examples to document pop in its own
right (and apply in terms of pop), and use stash/pop in the examples.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'sb/maint-1.6.2-opt-filename-fix'
Junio C Hamano [Fri, 29 May 2009 22:01:16 +0000 (15:01 -0700)]
Merge branch 'sb/maint-1.6.2-opt-filename-fix'

* sb/maint-1.6.2-opt-filename-fix:
  apply, fmt-merge-msg: use relative filenames
  commit: -F overrides -t

15 years agoMerge branch 'jc/maint-add-p-coalesce-fix'
Junio C Hamano [Fri, 29 May 2009 22:00:15 +0000 (15:00 -0700)]
Merge branch 'jc/maint-add-p-coalesce-fix'

* jc/maint-add-p-coalesce-fix:
  t3701: ensure correctly set up repository after skipped tests
  Revert "git-add--interactive: remove hunk coalescing"
  Splitting a hunk that adds a line at the top fails in "add -p"

15 years agoMerge branch 'rs/maint-grep-word-regexp-fix'
Junio C Hamano [Fri, 29 May 2009 21:59:50 +0000 (14:59 -0700)]
Merge branch 'rs/maint-grep-word-regexp-fix'

* rs/maint-grep-word-regexp-fix:
  grep: fix word-regexp at the beginning of lines

15 years agot9120: don't expect failure with SVN_HTTPD_PORT unset
Stephen Boyd [Tue, 26 May 2009 06:15:47 +0000 (23:15 -0700)]
t9120: don't expect failure with SVN_HTTPD_PORT unset

The test still passes when SVN_HTTPD_PORT is not set. Futhermore, t9115
and t9118 don't check if SVN_HTTPD_PORT is set even though they both use
start_httpd() from lib-git-svn.sh. Admittedly, the test is not very
meaningful without SVN_HTTPD_PORT, as commit f5530b (support for funky
branch and project names over HTTP(S) 2007-11-11) states that the URI
escaping is only done over HTTP(S).

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: teach stash/pop workflow instead of stash/apply
Thomas Rast [Thu, 28 May 2009 09:40:15 +0000 (11:40 +0200)]
Documentation: teach stash/pop workflow instead of stash/apply

Recent discussion on the list showed some comments in favour of a
stash/pop workflow:

  http://marc.info/?l=git&m=124234911423358&w=2
  http://marc.info/?l=git&m=124235348327711&w=2

Change the stash documentation and examples to document pop in its own
right (and apply in terms of pop), and use stash/pop in the examples.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Fri, 29 May 2009 05:50:23 +0000 (22:50 -0700)]
Merge branch 'maint'

* maint:
  fix segfault showing an empty remote

15 years agogit-svn: refuse to dcommit non-UTF-8 messages
Eric Wong [Thu, 28 May 2009 07:56:23 +0000 (00:56 -0700)]
git-svn: refuse to dcommit non-UTF-8 messages

...without i18n.commitencoding set in the config.

SVN tries to store all commit messages in UTF-8, however it is
up to the job of the clients to enforce this rule.  SVN servers
themselves do not always enforce this; allowing clients to
commit malformed UTF-8 messages and break repositories.

So git-svn will enforce this and tell the user to set
i18n.commitencoding when a git commit is is not in UTF-8.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agofix segfault showing an empty remote
Clemens Buchacher [Wed, 27 May 2009 20:13:43 +0000 (22:13 +0200)]
fix segfault showing an empty remote

In case of an empty list, the search for its tail caused a
NULL-pointer dereference.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Reported-by: Erik Faye-Lund <kusmabite@googlemail.com>
Acked-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot8005: fix typo, it's ISO-8859-5, not KOI8-R
Brandon Casey [Thu, 28 May 2009 01:57:45 +0000 (20:57 -0500)]
t8005: fix typo, it's ISO-8859-5, not KOI8-R

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot5500: Modernize test style
Stephen Boyd [Tue, 26 May 2009 06:17:14 +0000 (23:17 -0700)]
t5500: Modernize test style

Code outside of the test harness was emitting "Initializing..." from
git-init. Fixup this test to be more modern:

    - test_expect_object_count() and count_objects() are unused

    - use grep directly instead of test "..." = $(grep ...)

    - end the test_expect_success line with a single-quote and put the
      test on a new line

    - put as much code inside the test harness as possible

    - no_strict_count_check is unused and duplicates the test
      "new object count"

    - use && whenever possible to catch errors early

    - use test_tick instead of GIT_AUTHOR_DATE=$sec

    - remove debugging aid log.txt

    - use subshells instead of cd-ing around

Also merge the pull test into one large test.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: fix PS1 display during an AM on detached HEAD
Junio C Hamano [Tue, 26 May 2009 05:56:03 +0000 (22:56 -0700)]
completion: fix PS1 display during an AM on detached HEAD

This is a companion patch to previous 8763dbb (completion: fix PS1 display
during a merge on detached HEAD, 2009-05-16).  While rebasing or running am
on a detached HEAD, the code failed to set $b (branch description) that
enables the whole status display business.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoimap-send: add support for IPv6
Benjamin Kramer [Mon, 25 May 2009 19:13:54 +0000 (21:13 +0200)]
imap-send: add support for IPv6

Add IPv6 support by implementing name resolution with the
protocol agnostic getaddrinfo(3) API. The old gethostbyname(3)
code is still available when git is compiled with NO_IPV6.

Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes to 1.6.4
Junio C Hamano [Tue, 26 May 2009 02:46:17 +0000 (19:46 -0700)]
Update draft release notes to 1.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 26 May 2009 02:44:52 +0000 (19:44 -0700)]
Merge branch 'maint'

* maint:
  Prepare for 1.6.3.2
  fix cat-file usage message and documentation
  fetch: report ref storage DF errors more accurately
  lock_ref: inform callers of unavailable ref
  merge-options.txt: Clarify merge --squash

Conflicts:
RelNotes

15 years agoPrepare for 1.6.3.2
Junio C Hamano [Tue, 26 May 2009 02:20:39 +0000 (19:20 -0700)]
Prepare for 1.6.3.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'js/maint-no-ln-across-libexec-and-bin' into maint
Junio C Hamano [Tue, 26 May 2009 02:04:29 +0000 (19:04 -0700)]
Merge branch 'js/maint-no-ln-across-libexec-and-bin' into maint

* js/maint-no-ln-across-libexec-and-bin:
  Add NO_CROSS_DIRECTORY_HARDLINKS support to the Makefile

Conflicts:
Makefile

15 years agoMerge branch 'lt/maint-diff-reduce-lstat' into maint
Junio C Hamano [Tue, 26 May 2009 02:04:08 +0000 (19:04 -0700)]
Merge branch 'lt/maint-diff-reduce-lstat' into maint

* lt/maint-diff-reduce-lstat:
  Teach 'git checkout' to preload the index contents
  Avoid unnecessary 'lstat()' calls in 'get_stat_data()'

15 years agoMerge branch 'jm/format-patch-no-auto-n-when-k-is-given' into maint
Junio C Hamano [Tue, 26 May 2009 02:03:52 +0000 (19:03 -0700)]
Merge branch 'jm/format-patch-no-auto-n-when-k-is-given' into maint

* jm/format-patch-no-auto-n-when-k-is-given:
  format-patch let -k override a config-specified format.numbered

15 years agoMerge branch 'do/maint-merge-recursive-fix' into maint
Junio C Hamano [Tue, 26 May 2009 02:03:43 +0000 (19:03 -0700)]
Merge branch 'do/maint-merge-recursive-fix' into maint

* do/maint-merge-recursive-fix:
  merge-recursive: never leave index unmerged while recursing

15 years agoMerge branch 'jk/maint-1.6.0-trace-argv' into maint
Junio C Hamano [Tue, 26 May 2009 02:03:20 +0000 (19:03 -0700)]
Merge branch 'jk/maint-1.6.0-trace-argv' into maint

* jk/maint-1.6.0-trace-argv:
  fix GIT_TRACE segfault with shell-quoted aliases

Conflicts:
alias.c

15 years agoMerge branch 'np/push-delta' into maint
Junio C Hamano [Tue, 26 May 2009 02:02:11 +0000 (19:02 -0700)]
Merge branch 'np/push-delta' into maint

* np/push-delta:
  allow OFS_DELTA objects during a push

15 years agoMerge branch 'ar/merge-one-file-diag' into maint
Junio C Hamano [Tue, 26 May 2009 02:01:59 +0000 (19:01 -0700)]
Merge branch 'ar/merge-one-file-diag' into maint

* ar/merge-one-file-diag:
  Clarify kind of conflict in merge-one-file helper

15 years agoMerge branch 'ar/unlink-err' into maint
Junio C Hamano [Tue, 26 May 2009 02:01:50 +0000 (19:01 -0700)]
Merge branch 'ar/unlink-err' into maint

* ar/unlink-err:
  print unlink(2) errno in copy_or_link_directory
  replace direct calls to unlink(2) with unlink_or_warn
  Introduce an unlink(2) wrapper which gives warning if unlink failed

15 years agoMerge branch 'jk/maint-add-empty' into maint
Junio C Hamano [Tue, 26 May 2009 02:01:41 +0000 (19:01 -0700)]
Merge branch 'jk/maint-add-empty' into maint

* jk/maint-add-empty:
  add: don't complain when adding empty project root

15 years agofix cat-file usage message and documentation
Jeff King [Mon, 25 May 2009 10:33:15 +0000 (06:33 -0400)]
fix cat-file usage message and documentation

cat-file with an object on the command line requires an
option to tell it what to output (type, size, pretty-print,
etc). However, the square brackets in the usage imply that
those options are not required. This patch switches them to
parentheses to indicate "required but grouped-OR" (curly
braces might also work, but this follows the convention used
already by "git stash").

While we're at it, let's change the <sha1> specifier in the
usage to <object>. That's what the documentation uses, and
it does actually use the regular object lookup.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofetch: report ref storage DF errors more accurately
Jeff King [Mon, 25 May 2009 10:40:54 +0000 (06:40 -0400)]
fetch: report ref storage DF errors more accurately

When we fail to store a fetched ref, we recommend that the
user try running "git prune" to remove up any old refs that
have been deleted by the remote, which would clear up any DF
conflicts. However, ref storage might fail for other
reasons (e.g., permissions problems) in which case the
advice is useless and misleading.

This patch detects when there is an actual DF situation and
only issues the advice when one is found.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agolock_ref: inform callers of unavailable ref
Jeff King [Mon, 25 May 2009 10:37:15 +0000 (06:37 -0400)]
lock_ref: inform callers of unavailable ref

One of the ways that locking might fail is that there is a
DF conflict between two refs (e.g., you want to lock
"foo/bar" but "foo" already exists). In this case, we return
an error, but there is no way for the caller to know the
specific problem.

This patch sets errno to ENOTDIR, which is the most sensible
code. It's what we would see if the refs were stored purely
in the filesystem (but these days we must check the
namespace manually due to packed refs).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconvert bare readlink to strbuf_readlink
Jeff King [Mon, 25 May 2009 10:46:09 +0000 (06:46 -0400)]
convert bare readlink to strbuf_readlink

This particular readlink call never NUL-terminated its
result, making it a potential source of bugs (though there
is no bug now, as it currently always respects the length
field). Let's just switch it to strbuf_readlink which is
shorter and less error-prone.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3701: ensure correctly set up repository after skipped tests
Johannes Sixt [Mon, 25 May 2009 12:07:55 +0000 (14:07 +0200)]
t3701: ensure correctly set up repository after skipped tests

There are two tests that are skipped if file modes are not obeyed by the
file system. In this case, the subsequent test failed because the
repository was in an unexpected state. This corrects it.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomerge-options.txt: Clarify merge --squash
Michael J Gruber [Mon, 25 May 2009 16:00:10 +0000 (18:00 +0200)]
merge-options.txt: Clarify merge --squash

With the --squash option, merge sets up the index just like for a real
merge, but without the merge info (stages). Say so.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoparse-opts: add OPT_FILENAME and transition builtins
Stephen Boyd [Sat, 23 May 2009 18:53:13 +0000 (11:53 -0700)]
parse-opts: add OPT_FILENAME and transition builtins

Commit dbd0f5c (Files given on the command line are relative to $cwd,
2008-08-06) introduced parse_options_fix_filename() as a minimal fix.
OPT_FILENAME is intended to be a more robust fix for the same issue.
OPT_FILENAME and its associated enum OPTION_FILENAME are used to
represent filename options within the parse options API.

This option is similar to OPTION_STRING. If --no is prefixed to the
option the filename is unset. If no argument is given and the default
value is set, the filename is set to the default value. The difference
is that the filename is prefixed with the prefix passed to
parse_options() (or parse_options_start()).

Update git-apply, git-commit, git-fmt-merge-msg, and git-tag to use
OPT_FILENAME with their filename options. Also, rename
parse_options_fix_filename() to fix_filename() as it is no longer
extern.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoparse-opts: prepare for OPT_FILENAME
Stephen Boyd [Sat, 23 May 2009 18:53:12 +0000 (11:53 -0700)]
parse-opts: prepare for OPT_FILENAME

To give OPT_FILENAME the prefix, we pass the prefix to parse_options()
which passes the prefix to parse_options_start() which sets the prefix
member of parse_opts_ctx accordingly. If there isn't a prefix in the
calling context, passing NULL will suffice.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/mktree' into sb/opt-filename
Junio C Hamano [Mon, 25 May 2009 08:04:10 +0000 (01:04 -0700)]
Merge branch 'jc/mktree' into sb/opt-filename

* jc/mktree:
  mktree: validate entry type in input
  mktree --batch: build more than one tree object
  mktree --missing: updated usage message and man page
  mktree --missing: allow missing objects
  t1010: add mktree test
  mktree: do not barf on a submodule commit
  builtin-mktree.c: use a helper function to handle one line of input
  mktree: use parse-options
  build-in git-mktree

15 years agoMerge branch 'sb/format-patch-parseopt' into sb/opt-filename
Junio C Hamano [Mon, 25 May 2009 07:59:59 +0000 (00:59 -0700)]
Merge branch 'sb/format-patch-parseopt' into sb/opt-filename

* sb/format-patch-parseopt:
  format-patch: migrate to parse-options API

Conflicts:
builtin-log.c

15 years agoMerge branch 'sb/show-branch-parse-options' into sb/opt-filename
Junio C Hamano [Mon, 25 May 2009 07:59:29 +0000 (00:59 -0700)]
Merge branch 'sb/show-branch-parse-options' into sb/opt-filename

* sb/show-branch-parse-options:
  show-branch: migrate to parse-options API
  parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's

Conflicts:
parse-options.h

15 years agoMerge branch 'master' into sb/opt-filename
Junio C Hamano [Mon, 25 May 2009 07:59:07 +0000 (00:59 -0700)]
Merge branch 'master' into sb/opt-filename

* master: (654 commits)
  http-push.c::remove_locks(): fix use after free
  t/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C
  post-receive-email: hooks.showrev: show how to include both web link and patch
  MinGW: Fix compiler warning in merge-recursive
  MinGW: Add a simple getpass()
  MinGW: use POSIX signature of waitpid()
  MinGW: the path separator to split GITPERLLIB is ';' on Win32
  MinGW: Scan for \r in addition to \n when reading shbang lines
  gitweb: Sanitize title attribute in format_subject_html
  Terminate argv with NULL before calling setup_revisions()
  doc/git-rebase.txt: remove mention of multiple strategies
  git-send-email: Handle quotes when parsing .mailrc files
  git-svn: add --authors-prog option
  git-svn: Set svn.authorsfile if it is passed to git svn clone
  git-svn: Correctly report max revision when following deleted paths
  git-svn: Fix for svn paths removed > log-window-size revisions ago
  git-svn testsuite: use standard configuration for Subversion tools
  grep: fix word-regexp colouring
  completion: use git rev-parse to detect bare repos
  Cope better with a _lot_ of packs
  ...

15 years agoChange xdl_merge to generate output even for null merges
Charles Bailey [Mon, 25 May 2009 00:21:14 +0000 (01:21 +0100)]
Change xdl_merge to generate output even for null merges

xdl_merge used to have a check to ensure that there was at least
some change in one or other side being merged but this suppressed
output for the degenerate case when base, local and remote
contents were all identical.

Removing this check enables correct output in the degenerate case
and xdl_free_script handles freeing NULL scripts so there is no
need to have the check for these calls.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot6023: merge-file fails to output anything for a degenerate merge
Charles Bailey [Mon, 25 May 2009 00:21:13 +0000 (01:21 +0100)]
t6023: merge-file fails to output anything for a degenerate merge

In the case that merge-file is passed three files with identical
contents it wipes the contents of the output file instead of
leaving it unchanged.

Althought merge-file is porcelain and this will never happen in
normal usage, it is still wrong.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 24 May 2009 22:29:55 +0000 (15:29 -0700)]
Merge branch 'maint'

* maint:
  http-push.c::remove_locks(): fix use after free

15 years agoMerge branch 'maint-1.6.2' into maint
Junio C Hamano [Sun, 24 May 2009 22:29:33 +0000 (15:29 -0700)]
Merge branch 'maint-1.6.2' into maint

* maint-1.6.2:
  http-push.c::remove_locks(): fix use after free

15 years agoMerge branch 'maint-1.6.1' into maint-1.6.2
Junio C Hamano [Sun, 24 May 2009 22:29:23 +0000 (15:29 -0700)]
Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:
  http-push.c::remove_locks(): fix use after free

15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Sun, 24 May 2009 22:29:13 +0000 (15:29 -0700)]
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  http-push.c::remove_locks(): fix use after free

15 years agoapply: handle filenames with double slashes better
Michal Marek [Thu, 21 May 2009 12:25:11 +0000 (14:25 +0200)]
apply: handle filenames with double slashes better

When there are duplicated slashes in pathnames, like this:

--- a/perl//Git.pm
+++ b/perl//Git.pm
@@ -1358,3 +1358,4 @@

 1; # Famous last words
+# test

the paths gleaned from the patch header won't be found in the index and
cause "apply --index" and "apply --cached" to fail.

Fix this by squashing the duplicated slashes upon input.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohttp-push.c::remove_locks(): fix use after free
Alex Riesen [Sun, 24 May 2009 13:16:49 +0000 (15:16 +0200)]
http-push.c::remove_locks(): fix use after free

Noticed and reported by Serhat Şevki Dinçer.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C
Nguyễn Thái Ngọc Duy [Sat, 23 May 2009 15:31:02 +0000 (01:31 +1000)]
t/t3400-rebase.sh: add more tests to help migrating git-rebase.sh to C

These new tests make sure I don't miss any check being performed before
rebase is proceeded (which is well tested by other tests)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: fix word-regexp at the beginning of lines
René Scharfe [Sat, 23 May 2009 11:45:26 +0000 (13:45 +0200)]
grep: fix word-regexp at the beginning of lines

After bol is forwarded, it doesn't represent the beginning of the line
any more.  This means that the beginning-of-line marker (^) mustn't match,
i.e. the regex flag REG_NOTBOL needs to be set.

This bug was introduced by fb62eb7fab97cea880ea7fe4f341a4dfad14ab48
("grep -w: forward to next possible position after rejected match").

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply, fmt-merge-msg: use relative filenames
Stephen Boyd [Sat, 23 May 2009 18:53:11 +0000 (11:53 -0700)]
apply, fmt-merge-msg: use relative filenames

Commit dbd0f5c7 (Files given on the command line are relative to $cwd,
2008-08-06) only fixed git-commit and git-tag. But, git-apply and
git-fmt-merge-msg didn't get the update and exhibit the same behavior.

Fix them and add tests for "apply --build-fake-ancestor" and
"fmt-merge-msg -F".

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocommit: -F overrides -t
Stephen Boyd [Sat, 23 May 2009 18:53:10 +0000 (11:53 -0700)]
commit: -F overrides -t

Commit dbd0f5c7 (Files given on the command line are relative to $cwd,
2008-08-06) introduced parse_options_fix_filename() as a quick fix for
filename arguments used in the parse options API.

git-commit was still broken. This means

    git commit -F log -t temp

in a subdirectory would make git think the log message should be taken
from temp instead of log.

This is because parse_options_fix_filename() calls prefix_filename()
which uses a single static char buffer to do its work. Making two calls
with two char pointers causes the pointers to alias. To prevent
aliasing, we duplicate the string returned by
parse_options_fix_filename().

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopost-receive-email: hooks.showrev: show how to include both web link and patch
Jim Meyering [Sat, 23 May 2009 12:26:44 +0000 (14:26 +0200)]
post-receive-email: hooks.showrev: show how to include both web link and patch

Add a comment showing how to include a web link (i.e. gitweb/cgit)
and a patch in the email that is sent for each pushed commit.

The quoting was tricky enough that it's worth documenting.  To add
two blank lines (i.e. put \n\n in the printf), you would need to
say \\\\n\\\\n, and in the end, the pair of "echo" statements seemed
better.  This is used in glibc.git repository:

  http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=summary

push-triggered messages have been sent to this list since May 21:

  http://sourceware.org/ml/glibc-cvs/2009-q2/

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: Fix compiler warning in merge-recursive
Johannes Schindelin [Sat, 23 May 2009 08:04:51 +0000 (10:04 +0200)]
MinGW: Fix compiler warning in merge-recursive

GCC 4.4.0 on Windows does not like the format %zu.  It is quite unlikely,
though, that we need more merge bases than a %d can display, so replace
the %zu by a %d.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: Add a simple getpass()
Johannes Schindelin [Sat, 23 May 2009 08:04:50 +0000 (10:04 +0200)]
MinGW: Add a simple getpass()

We need getpass() to activate curl on MinGW.  Although the default
Makefile currently has 'NO_CURL = YesPlease', msysgit releases do
provide curl support, so getpass() is used.

[spr: - edited commit message.
      - squashed commit that provides getpass() declaration.]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>