git.git
13 years agogit p4: disable read-only attribute before deleting
Pete Wyckoff [Sun, 27 Jan 2013 03:11:19 +0000 (22:11 -0500)]
git p4: disable read-only attribute before deleting

On windows, p4 marks un-edited files as read-only.  Not only are
they read-only, but also they cannot be deleted.  Remove the
read-only attribute before deleting in both the copy and rename
cases.

This also happens in the RCS cleanup code, where a file is marked
to be deleted, but must first be edited to remove adjust the
keyword lines.  Make sure it is editable before patching.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: use test_chmod for cygwin
Pete Wyckoff [Sun, 27 Jan 2013 03:11:18 +0000 (22:11 -0500)]
git p4 test: use test_chmod for cygwin

This test does a commit that is a pure mode change, submits
it to p4 but causes the submit to fail.  It verifies that
the state in p4 as well as the client directory are both
unmodified after the failed submit.

On cygwin, "chmod +x" does nothing, so use the test_chmod
function to modify the index directly too.

Also on cygwin, the executable bit cannot be seen in the
filesystem, so avoid that part of the test.  The checks of
p4 state are still valid, though.

Thanks-to: Johannes Sixt <redacted>
Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4: cygwin p4 client does not mark read-only
Pete Wyckoff [Sun, 27 Jan 2013 03:11:17 +0000 (22:11 -0500)]
git p4: cygwin p4 client does not mark read-only

There are some old versions of p4, compiled for cygwin, that
treat read-only files differently.

Normally, a file that is not open is read-only, meaning that
"test -w" on the file is false.  This works on unix, and it works
on windows using the NT version of p4.  The cygwin version
of p4, though, changes the permissions, but does not set the
windows read-only attribute, so "test -w" returns false.

Notice this oddity and make the tests work, even on cygiwn.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: avoid wildcard * in windows
Pete Wyckoff [Sun, 27 Jan 2013 03:11:16 +0000 (22:11 -0500)]
git p4 test: avoid wildcard * in windows

This character is not valid in windows filenames, even though
it can appear in p4 depot paths.  Avoid using it in tests on
windows, both mingw and cygwin.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: use LineEnd unix in windows tests too
Pete Wyckoff [Sun, 27 Jan 2013 03:11:15 +0000 (22:11 -0500)]
git p4 test: use LineEnd unix in windows tests too

In all clients, even those created on windows, use unix line
endings.  This makes it possible to verify file contents without
doing OS-specific comparisons in all the tests.

Tests in t9802-git-p4-filetype.sh are used to make sure that
the other LineEnd options continue to work.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: newline handling
Pete Wyckoff [Sun, 27 Jan 2013 03:11:14 +0000 (22:11 -0500)]
git p4 test: newline handling

P4 stores newlines in the depos as \n.  By default, git does this
too, both on unix and windows.  Test to make sure that this stays
true.

Both git and p4 have mechanisms to use \r\n in the working
directory.  Exercise these.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4: scrub crlf for utf16 files on windows
Pete Wyckoff [Sun, 27 Jan 2013 03:11:13 +0000 (22:11 -0500)]
git p4: scrub crlf for utf16 files on windows

Files of type utf16 are handled with "p4 print" instead of the
normal "p4 -G print" interface due to how the latter does not
produce correct output.  See 55aa571 (git-p4: handle utf16
filetype properly, 2011-09-17) for details.

On windows, though, "p4 print" can not be told which line
endings to use, as there is no underlying client, and always
chooses crlf, even for utf16 files.  Convert the \r\n into \n
when importing utf16 files.

The fix for this is complex, in that the problem is a property
of the NT version of p4.  There are old versions of p4 that
were compiled directly for cygwin that should not be subjected
to text replacement.  The right check here, then, is to look
at the p4 version, not the OS version.  Note also that on cygwin,
platform.system() is "CYGWIN_NT-5.1" or similar, not "Windows".

Add a function to memoize the p4 version string and use it to
check for "/NT", indicating the Windows build of p4.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4: remove unreachable windows \r\n conversion code
Pete Wyckoff [Sun, 27 Jan 2013 03:11:12 +0000 (22:11 -0500)]
git p4: remove unreachable windows \r\n conversion code

Replacing \r\n with \n on windows was added in c1f9197 (Replace
\r\n with \n when importing from p4 on Windows, 2007-05-24), to
work around an oddity with "p4 print" on windows.  Text files
are printed with "\r\r\n" endings, regardless of whether they
were created on unix or windows, and regardless of the client
LineEnd setting.

As of d2c6dd3 (use p4CmdList() to get file contents in Python
dicts. This is more robust., 2007-05-23), git-p4 uses "p4 -G
print", which generates files in a raw format.  As the native
line ending format if p4 is \n, there will be no \r\n in the
raw text.

Actually, it is possible to generate a text file so that the
p4 representation includes embedded \r\n, even though this is not
normal on either windows or unix.  In that case the code would
have mistakenly stripped them out, but now they will be left
intact.

More information on how p4 deals with line endings is here:

    http://kb.perforce.com/article/63

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: translate windows paths for cygwin
Pete Wyckoff [Sun, 27 Jan 2013 03:11:11 +0000 (22:11 -0500)]
git p4 test: translate windows paths for cygwin

Native windows binaries do not understand posix-like
path mapping offered by cygwin.  Convert paths to native
using "cygpath --windows" before presenting them to p4d.

This is done using the AltRoots mechanism of p4.  Both the
posix and windows forms are put in the client specification,
allowing p4 to find its location by native path even though
the environment reports a different PWD.

Shell operations in tests will use the normal form of $cli,
which will look like a posix path in cygwin, while p4 will
use AltRoots to match against the windows form of the working
directory.

This mechanism also handles the symlink issue that was fixed in
23bd0c9 (git p4 test: use real_path to resolve p4 client
symlinks, 2012-06-27).  Now that every p4 client view has
an AltRoots with the real_path in it, explicitly calculating
the real_path elsewhere is not necessary.

Thanks-to: Sebastian Schuberth <redacted>
Thanks-to: Johannes Sixt <redacted>
fixup! git p4 test: translate windows paths for cygwin

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: start p4d inside its db dir
Pete Wyckoff [Sun, 27 Jan 2013 03:11:10 +0000 (22:11 -0500)]
git p4 test: start p4d inside its db dir

This will avoid having to do native path conversion for
windows.  Also may be a bit cleaner always to know that p4d
has that working directory, instead of wherever the function
was called from.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: use client_view in t9806
Pete Wyckoff [Sun, 27 Jan 2013 03:11:09 +0000 (22:11 -0500)]
git p4 test: use client_view in t9806

Use the standard client_view function from lib-git-p4.sh
instead of building one by hand.  This requires a bit of
rework, using the current value of $P4CLIENT for the client
name.  It also reorganizes the test to isolate changes to
$P4CLIENT and $cli in a subshell.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: avoid loop in client_view
Pete Wyckoff [Sun, 27 Jan 2013 03:11:08 +0000 (22:11 -0500)]
git p4 test: avoid loop in client_view

The printf command re-interprets the format string as
long as there are arguments to consume.  Use this to
simplify a for loop in the client_view() library function.

This requires a fix to one of the client_view callers.
An errant \n in the string was converted into a harmless
newline in the input to "p4 client -i", but now shows up
as a literal \n as passed through by "%s".  Remove the \n.

Based-on-patch-by: Junio C Hamano <redacted>
Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4 test: use client_view to build the initial client
Pete Wyckoff [Sun, 27 Jan 2013 03:11:07 +0000 (22:11 -0500)]
git p4 test: use client_view to build the initial client

Simplify the code a bit by using an existing function.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4: generate better error message for bad depot path
Pete Wyckoff [Sun, 27 Jan 2013 03:11:06 +0000 (22:11 -0500)]
git p4: generate better error message for bad depot path

Depot paths must start with //.  Exit with a better explanation
when a bad depot path is supplied.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4: remove unused imports
Pete Wyckoff [Sun, 27 Jan 2013 03:11:05 +0000 (22:11 -0500)]
git p4: remove unused imports

Found by "pyflakes" checker tool.
Modules shelve, getopt were unused.
Module os.path is exported by os.
Reformat one-per-line as is PEP008 suggested style.

Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit p4: temp branch name should use / even on windows
Pete Wyckoff [Sun, 27 Jan 2013 03:11:04 +0000 (22:11 -0500)]
git p4: temp branch name should use / even on windows

Commit fed2369 (git-p4: Search for parent commit on branch creation,
2012-01-25) uses temporary branches to help find the parent of a
new p4 branch.  The temp branches are of the form "git-p4-tmp/%d"
for some p4 change number.  Mistakenly, this string was made
using os.path.join() instead of just string concatenation.  On
windows, this turns into a backslash (\), which is not allowed in
git branch names.

Reported-by: Casey McGinty <redacted>
Signed-off-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge branch 'jk/maint-gc-auto-after-fetch' into jk/gc-auto-after-fetch
Junio C Hamano [Sun, 27 Jan 2013 03:42:09 +0000 (19:42 -0800)]
Merge branch 'jk/maint-gc-auto-after-fetch' into jk/gc-auto-after-fetch

* jk/maint-gc-auto-after-fetch:
  fetch-pack: avoid repeatedly re-scanning pack directory
  fetch: run gc --auto after fetching

13 years agofetch-pack: avoid repeatedly re-scanning pack directory
Jeff King [Sat, 26 Jan 2013 22:40:43 +0000 (17:40 -0500)]
fetch-pack: avoid repeatedly re-scanning pack directory

When we look up a sha1 object for reading via parse_object() =>
read_sha1_file() => read_object() callpath, we first check
packfiles, and then loose objects. If we still haven't found it, we
re-scan the list of packfiles in `objects/pack`. This final step
ensures that we can co-exist with a simultaneous repack process
which creates a new pack and then prunes the old object.

This extra re-scan usually does not have a performance impact for
two reasons:

  1. If an object is missing, then typically the re-scan will find a
     new pack, then no more misses will occur.  Or if it truly is
     missing, then our next step is usually to die().

  2. Re-scanning is cheap enough that we do not even notice.

However, these do not always hold. The assumption in (1) is that the
caller is expecting to find the object. This is usually the case,
but the call to `parse_object` in `everything_local` does not follow
this pattern. It is looking to see whether we have objects that the
remote side is advertising, not something we expect to
have. Therefore if we are fetching from a remote which has many refs
pointing to objects we do not have, we may end up re-scanning the
pack directory many times.

Even with this extra re-scanning, the impact is often not noticeable
due to (2); we just readdir() the packs directory and skip any packs
that are already loaded. However, if there are a large number of
packs, even enumerating the directory can be expensive, especially
if we do it repeatedly.

Having this many packs is a good sign the user should run `git gc`,
but it would still be nice to avoid having to scan the directory at
all.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agofetch: run gc --auto after fetching
Jeff King [Sat, 26 Jan 2013 22:40:38 +0000 (17:40 -0500)]
fetch: run gc --auto after fetching

We generally try to run "gc --auto" after any commands that
might introduce a large number of new objects. An obvious
place to do so is after running "fetch", which may introduce
new loose objects or packs (depending on the size of the
fetch).

While an active developer repository will probably
eventually trigger a "gc --auto" on another action (e.g.,
git-rebase), there are two good reasons why it is nicer to
do it at fetch time:

  1. Read-only repositories which track an upstream (e.g., a
     continuous integration server which fetches and builds,
     but never makes new commits) will accrue loose objects
     and small packs, but never coalesce them into a more
     efficient larger pack.

  2. Fetching is often already perceived to be slow to the
     user, since they have to wait on the network. It's much
     more pleasant to include a potentially slow auto-gc as
     part of the already-long network fetch than in the
     middle of productive work with git-rebase or similar.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agomergetools: support TortoiseGitMerge
Sven Strickroth [Sat, 26 Jan 2013 01:15:57 +0000 (02:15 +0100)]
mergetools: support TortoiseGitMerge

TortoiseMerge.exe was ben renamed to TortoiseGitMerge.exe (starting
with 1.8.0) in order to make it clear that it has special support
for git, and prevent confusion with the TortoiseSVN TortoiseMerge
version.

Signed-off-by: Sven Strickroth <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-p4.py: support Python 2.4
Brandon Casey [Sat, 26 Jan 2013 19:14:33 +0000 (11:14 -0800)]
git-p4.py: support Python 2.4

Python 2.4 lacks the following features:

   subprocess.check_call
   struct.pack_into

Take a cue from 460d1026 and provide an implementation of the
CalledProcessError exception.  Then replace the calls to
subproccess.check_call with calls to subprocess.call that check the return
status and raise a CalledProcessError exception if necessary.

The struct.pack_into in t/9802 can be converted into a single struct.pack
call which is available in Python 2.4.

Signed-off-by: Brandon Casey <redacted>
Acked-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-p4.py: support Python 2.5
Brandon Casey [Sat, 26 Jan 2013 19:14:32 +0000 (11:14 -0800)]
git-p4.py: support Python 2.5

Python 2.5 and older do not accept None as the first argument to
translate() and complain with:

   TypeError: expected a character buffer object

As suggested by Pete Wyckoff, let's just replace the call to translate()
with a regex search which should be more clear and more portable.

This allows git-p4 to be used with Python 2.5.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agologmsg_reencode: lazily load missing commit buffers
Jeff King [Sat, 26 Jan 2013 09:44:28 +0000 (04:44 -0500)]
logmsg_reencode: lazily load missing commit buffers

Usually a commit that makes it to logmsg_reencode will have
been parsed, and the commit->buffer struct member will be
valid. However, some code paths will free commit buffers
after having used them (for example, the log traversal
machinery will do so to keep memory usage down).

Most of the time this is fine; log should only show a commit
once, and then exits. However, there are some code paths
where this does not work. At least two are known:

  1. A commit may be shown as part of a regular ref, and
     then it may be shown again as part of a submodule diff
     (e.g., if a repo contains refs to both the superproject
     and subproject).

  2. A notes-cache commit may be shown during "log --all",
     and then later used to access a textconv cache during a
     diff.

Lazily loading in logmsg_reencode does not necessarily catch
all such cases, but it should catch most of them. Users of
the commit buffer tend to be either parsing for structure
(in which they will call parse_commit, and either we will
already have parsed, or we will load commit->buffer lazily
there), or outputting (either to the user, or fetching a
part of the commit message via format_commit_message). In
the latter case, we should always be using logmsg_reencode
anyway (and typically we do so via the pretty-print
machinery).

If there are any cases that this misses, we can fix them up
to use logmsg_reencode (or handle them on a case-by-case
basis if that is inappropriate).

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agologmsg_reencode: never return NULL
Jeff King [Sat, 26 Jan 2013 09:44:06 +0000 (04:44 -0500)]
logmsg_reencode: never return NULL

The logmsg_reencode function will return the reencoded
commit buffer, or NULL if reencoding failed or no reencoding
was necessary. Since every caller then ends up checking for NULL
and just using the commit's original buffer, anyway, we can
be a bit more helpful and just return that buffer when we
would have returned NULL.

Since the resulting string may or may not need to be freed,
we introduce a logmsg_free, which checks whether the buffer
came from the commit object or not (callers either
implemented the same check already, or kept two separate
pointers, one to mark the buffer to be used, and one for the
to-be-freed string).

Pushing this logic into logmsg_* simplifies the callers, and
will let future patches lazily load the commit buffer in a
single place.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agocommit: drop useless xstrdup of commit message
Jeff King [Sat, 26 Jan 2013 09:42:45 +0000 (04:42 -0500)]
commit: drop useless xstrdup of commit message

When git-commit is asked to reuse a commit message via "-c",
we call read_commit_message, which looks up the commit and
hands back either the re-encoded result, or a copy of the
original. We make a copy in the latter case so that the
ownership semantics of the return value are clear (in either
case, it can be freed).

However, since we return a "const char *", and since the
resulting buffer's lifetime is the same as that of the whole
program, we never bother to free it at all.

Let's just drop the copy. That saves us a copy in the common
case. While it does mean we leak in the re-encode case, it
doesn't matter, since we are relying on program exit to free
the memory anyway.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge branch 'for-junio' of git://bogomips.org/git-svn
Junio C Hamano [Fri, 25 Jan 2013 20:53:31 +0000 (12:53 -0800)]
Merge branch 'for-junio' of git://bogomips.org/git-svn

* 'for-junio' of git://bogomips.org/git-svn:
  git-svn: Simplify calculation of GIT_DIR
  git-svn: cleanup sprintf usage for uppercasing hex

13 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Fri, 25 Jan 2013 20:52:55 +0000 (12:52 -0800)]
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge branch 'nd/retire-fnmatch'
Junio C Hamano [Fri, 25 Jan 2013 20:34:55 +0000 (12:34 -0800)]
Merge branch 'nd/retire-fnmatch'

Replace our use of fnmatch(3) with a more feature-rich wildmatch.
A handful patches at the bottom have been moved to nd/wildmatch to
graduate as part of that branch, before this series solidifies.

We may want to mark USE_WILDMATCH as an experimental curiosity a
bit more clearly (i.e. should not be enabled in production
environment, because it will make the behaviour between builds
unpredictable).

* nd/retire-fnmatch:
  Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
  wildmatch: advance faster in <asterisk> + <literal> patterns
  wildmatch: make a special case for "*/" with FNM_PATHNAME
  test-wildmatch: add "perf" command to compare wildmatch and fnmatch
  wildmatch: support "no FNM_PATHNAME" mode
  wildmatch: make dowild() take arbitrary flags
  wildmatch: rename constants and update prototype

13 years agoMerge branch 'jc/doc-maintainer'
Junio C Hamano [Fri, 25 Jan 2013 20:34:52 +0000 (12:34 -0800)]
Merge branch 'jc/doc-maintainer'

Describe tools for automation that were invented since this
document was originally written.

* jc/doc-maintainer:
  howto/maintain: document "### match next" convention in jch/pu branch
  howto/maintain: mark titles for asciidoc
  Documentation: update "howto maintain git"

13 years agohowto/maintain: document "### match next" convention in jch/pu branch
Junio C Hamano [Fri, 25 Jan 2013 20:33:57 +0000 (12:33 -0800)]
howto/maintain: document "### match next" convention in jch/pu branch

Signed-off-by: Junio C Hamano <redacted>
13 years agogit-difftool: use git-mergetool--lib for "--tool-help"
John Keeping [Fri, 25 Jan 2013 09:43:51 +0000 (01:43 -0800)]
git-difftool: use git-mergetool--lib for "--tool-help"

The "--tool-help" option to git-difftool currently displays incorrect
output since it uses the names of the files in
"$GIT_EXEC_PATH/mergetools/" rather than the list of command names in
git-mergetool--lib.

Fix this by simply delegating the "--tool-help" argument to the
show_tool_help function in git-mergetool--lib.

Signed-off-by: John Keeping <redacted>
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-mergetool: don't hardcode 'mergetool' in show_tool_help
John Keeping [Fri, 25 Jan 2013 09:43:50 +0000 (01:43 -0800)]
git-mergetool: don't hardcode 'mergetool' in show_tool_help

When using show_tool_help from git-difftool we will want it to print
"git difftool" not "git mergetool" so use "git ${TOOL_MODE}tool".

Signed-off-by: John Keeping <redacted>
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-mergetool: remove redundant assignment
John Keeping [Fri, 25 Jan 2013 09:43:49 +0000 (01:43 -0800)]
git-mergetool: remove redundant assignment

TOOL_MODE is set at the top of git-mergetool.sh so there is no need to
set it again in show_tool_help.  Removing this lets us re-use
show_tool_help in git-difftool.

Signed-off-by: John Keeping <redacted>
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-mergetool: move show_tool_help to mergetool--lib
John Keeping [Fri, 25 Jan 2013 09:43:48 +0000 (01:43 -0800)]
git-mergetool: move show_tool_help to mergetool--lib

This is the first step in unifying "git difftool --tool-help" and
"git mergetool --tool-help".

Signed-off-by: John Keeping <redacted>
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoident: do not drop username when reading from /etc/mailname
Jonathan Nieder [Thu, 24 Jan 2013 23:21:46 +0000 (15:21 -0800)]
ident: do not drop username when reading from /etc/mailname

An earlier conversion from fgets() to strbuf_getline() in the
codepath to read from /etc/mailname to learn the default host-part
of the ident e-mail address forgot that strbuf_getline() stores the
line at the beginning of the buffer just like fgets().

The "username@" the caller has prepared in the strbuf, expecting the
function to append the host-part to it, was lost because of this.

Reported-by: Mihai Rusu <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agopush: finishing touches to explain REJECT_ALREADY_EXISTS better
Junio C Hamano [Fri, 25 Jan 2013 05:09:00 +0000 (21:09 -0800)]
push: finishing touches to explain REJECT_ALREADY_EXISTS better

Now that "already exists" errors are given only when a push tries to
update an existing ref in refs/tags/ hierarchy, we can say "the
tag", instead of "the destination reference", and that is far easier
to understand.

Pointed out by Chris Rorvick.

Signed-off-by: Junio C Hamano <redacted>
13 years agol10n: vi.po: updated Vietnamese translation
Tran Ngoc Quan [Fri, 25 Jan 2013 07:01:23 +0000 (14:01 +0700)]
l10n: vi.po: updated Vietnamese translation

* Updated new strings (1983t0f0u)
* Fix minor errors
* Updated copyright year

Signed-off-by: Tran Ngoc Quan <redacted>
13 years agoMerge branch 'master' of git://github.com/ralfth/git-po-de
Jiang Xin [Fri, 25 Jan 2013 04:46:07 +0000 (12:46 +0800)]
Merge branch 'master' of git://github.com/ralfth/git-po-de

* 'master' of git://github.com/ralfth/git-po-de:
  l10n: de.po: fix some minor issues

13 years agol10n: Update git.pot (11 new, 7 removed messages)
Jiang Xin [Fri, 25 Jan 2013 04:33:58 +0000 (12:33 +0800)]
l10n: Update git.pot (11 new, 7 removed messages)

Generate po/git.pot from v1.8.1-476-gec3ae6e, and there are 11 new and 7
removed messages.

Signed-off-by: Jiang Xin <redacted>
13 years agogit-remote-testpy: call print as a function
John Keeping [Sun, 20 Jan 2013 13:15:38 +0000 (13:15 +0000)]
git-remote-testpy: call print as a function

This is harmless in Python 2, which sees the parentheses as redundant
grouping, but is required for Python 3.  Since this is the only change
required to make this script just run under Python 3 without needing
2to3 it seems worthwhile.

The case of an empty print must be handled specially because in that
case Python 2 will interpret '()' as an empty tuple and print it as
'()'; inserting an empty string fixes this.

Signed-off-by: John Keeping <redacted>
Acked-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-remote-testpy: don't do unbuffered text I/O
John Keeping [Sun, 20 Jan 2013 13:15:37 +0000 (13:15 +0000)]
git-remote-testpy: don't do unbuffered text I/O

Python 3 forbids unbuffered I/O in text mode.  Change the reading of
stdin in git-remote-testpy so that we read the lines as bytes and then
decode them a line at a time.

This allows us to keep the I/O unbuffered in order to avoid
reintroducing the bug fixed by commit 7fb8e16 (git-remote-testgit: fix
race when spawning fast-import).

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-remote-testpy: hash bytes explicitly
John Keeping [Sun, 20 Jan 2013 13:15:36 +0000 (13:15 +0000)]
git-remote-testpy: hash bytes explicitly

Under Python 3 'hasher.update(...)' must take a byte string and not a
unicode string.  Explicitly encode the argument to this method to hex
bytes so that we don't need to worry about failures to encode that might
occur if we chose a textual encoding.

This changes the directory used by git-remote-testpy for its git mirror
of the remote repository, but this tool should not have any serious
users as it is used primarily to test the Python remote helper
framework.

The use of encode() moves the required Python version forward to 2.0.

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agosvn-fe: allow svnrdump_sim.py to run with Python 3
John Keeping [Sun, 20 Jan 2013 13:15:35 +0000 (13:15 +0000)]
svn-fe: allow svnrdump_sim.py to run with Python 3

The changes to allow this script to run with Python 3 are minimal and do
not affect its functionality on the versions of Python 2 that are
already supported (2.4 onwards).

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit_remote_helpers: use 2to3 if building with Python 3
John Keeping [Sun, 20 Jan 2013 13:15:34 +0000 (13:15 +0000)]
git_remote_helpers: use 2to3 if building with Python 3

Using the approach detailed in the Python documentation[1], run 2to3 on
the code as part of the build if building with Python 3.

The code itself requires no changes to convert cleanly.

[1] http://docs.python.org/3.3/howto/pyporting.html#during-installation

Signed-off-by: John Keeping <redacted>
Acked-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit_remote_helpers: force rebuild if python version changes
John Keeping [Sun, 20 Jan 2013 13:15:33 +0000 (13:15 +0000)]
git_remote_helpers: force rebuild if python version changes

When different version of python are used to build via distutils, the
behaviour can change.  Detect changes in version and pass --force in
this case.

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agot9902: protect test from stray build artifacts
Junio C Hamano [Thu, 24 Jan 2013 23:08:37 +0000 (15:08 -0800)]
t9902: protect test from stray build artifacts

When you have random build artifacts in your build directory, left
behind by running "make" while on another branch, the "git help -a"
command run by __git_list_all_commands in the completion script that
is being tested does not have a way to know that they are not part
of the subcommands this build will ship.  Such extra subcommands may
come from the user's $PATH.  They will interfere with the tests that
expect a certain prefix to uniquely expand to a known completion.

Instrument the completion script and give it a way for us to tell
what (subset of) subcommands we are going to ship.

Also add a test to "git --help <prefix><TAB>" expansion.  It needs
to show not just commands but some selected documentation pages.

Based on an idea by Jeff King.

Signed-off-by: Junio C Hamano <redacted>
13 years agopush: introduce REJECT_FETCH_FIRST and REJECT_NEEDS_FORCE
Junio C Hamano [Wed, 23 Jan 2013 21:55:30 +0000 (13:55 -0800)]
push: introduce REJECT_FETCH_FIRST and REJECT_NEEDS_FORCE

When we push to update an existing ref, if:

 * the object at the tip of the remote is not a commit; or
 * the object we are pushing is not a commit,

it won't be correct to suggest to fetch, integrate and push again,
as the old and new objects will not "merge".  We should explain that
the push must be forced when there is a non-committish object is
involved in such a case.

If we do not have the current object at the tip of the remote, we do
not even know that object, when fetched, is something that can be
merged.  In such a case, suggesting to pull first just like
non-fast-forward case may not be technically correct, but in
practice, most such failures are seen when you try to push your work
to a branch without knowing that somebody else already pushed to
update the same branch since you forked, so "pull first" would work
as a suggestion most of the time.  And if the object at the tip is
not a commit, "pull first" will fail, without making any permanent
damage.  As a side effect, it also makes the error message the user
will get during the next "push" attempt easier to understand, now
the user is aware that a non-commit object is involved.

In these cases, the current code already rejects such a push on the
client end, but we used the same error and advice messages as the
ones used when rejecting a non-fast-forward push, i.e. pull from
there and integrate before pushing again.

Introduce new rejection reasons and reword the messages
appropriately.

[jc: with help by Peff on message details]

Signed-off-by: Junio C Hamano <redacted>
13 years agopush: further simplify the logic to assign rejection reason
Junio C Hamano [Wed, 23 Jan 2013 21:14:48 +0000 (13:14 -0800)]
push: further simplify the logic to assign rejection reason

First compute the reason why this push would fail if done without
"--force", and then fail it by assigning that reason when the push
was not forced (or if there is no reason to require force, allow it
to succeed).

Record the fact that the push was forced in the forced_update field
only when the push would have failed without the option.

The code becomes shorter, less repetitive and easier to read this
way, especially given that the set of rejection reasons will be
extended in a later patch.

Signed-off-by: Junio C Hamano <redacted>
13 years agopush: further clean up fields of "struct ref"
Junio C Hamano [Tue, 22 Jan 2013 04:24:07 +0000 (20:24 -0800)]
push: further clean up fields of "struct ref"

The "nonfastforward" and "update" fields are only used while
deciding what value to assign to the "status" locally in a single
function.  Remove them from the "struct ref".

The "requires_force" field is not used to decide if the proposed
update requires a --force option to succeed, or to record such a
decision made elsewhere.  It is used by status reporting code that
the particular update was "forced".  Rename it to "forced_update",
and move the code to assign to it around to further clarify how it
is used and what it is used for.

Signed-off-by: Junio C Hamano <redacted>
13 years agot7102 (reset): don't hardcode SHA-1 in expected outputs
Alexey Shumkin [Thu, 24 Jan 2013 09:10:26 +0000 (13:10 +0400)]
t7102 (reset): don't hardcode SHA-1 in expected outputs

Take the expected SHA-1 digest in a variable, and use it instead of
hardcoding when checking the result.

Signed-off-by: Alexey Shumkin <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-cvsimport.txt: cvsps-2 is deprecated
John Keeping [Thu, 24 Jan 2013 19:18:45 +0000 (19:18 +0000)]
git-cvsimport.txt: cvsps-2 is deprecated

git-cvsimport relies on version 2 of cvsps and does not work with the
new version 3.  Since cvsps 3.x does not currently work as well as
version 2 for incremental import, document this fact.

Specifically, there is no way to make new git-cvsimport that supports
cvsps 3.x and have a seamless transition for existing users since cvsps
3.x needs a time from which to continue importing and git-cvsimport does
not save the time of the last import or import into a specific namespace
so there is no safe way to calculate the time of the last import.

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-svn: Simplify calculation of GIT_DIR
Barry Wardell [Mon, 21 Jan 2013 01:22:02 +0000 (01:22 +0000)]
git-svn: Simplify calculation of GIT_DIR

Since git-rev-parse already checks for the $GIT_DIR environment
variable and that it returns an actual git repository, there is no
need to repeat the checks again here.

This also fixes a problem where git-svn did not work in cases where
.git was a file with a gitdir: link.

[ew: squashed test case,
 delay setting GIT_DIR until after `git rev-parse --cdup` to fix t9101,
 (thanks to Junio)]

Signed-off-by: Barry Wardell <redacted>
Signed-off-by: Eric Wong <redacted>
13 years agogit-svn: cleanup sprintf usage for uppercasing hex
Eric Wong [Thu, 24 Jan 2013 00:23:44 +0000 (00:23 +0000)]
git-svn: cleanup sprintf usage for uppercasing hex

We do not need to call uc() separately for sprintf("%x")
as sprintf("%X") is available.

Signed-off-by: Eric Wong <redacted>
Reviewed-by: Jonathan Nieder <redacted>
13 years agoMerge branch 'as/pre-push-hook'
Junio C Hamano [Thu, 24 Jan 2013 05:19:25 +0000 (21:19 -0800)]
Merge branch 'as/pre-push-hook'

Add an extra hook so that "git push" that is run without making
sure what is being pushed is sane can be checked and rejected (as
opposed to the user deciding not pushing).

* as/pre-push-hook:
  Add sample pre-push hook script
  push: Add support for pre-push hooks
  hooks: Add function to check if a hook exists

13 years agoMerge branch 'ch/add-auto-submitted-in-sample-post-receive-email'
Junio C Hamano [Thu, 24 Jan 2013 05:19:19 +0000 (21:19 -0800)]
Merge branch 'ch/add-auto-submitted-in-sample-post-receive-email'

* ch/add-auto-submitted-in-sample-post-receive-email:
  Add Auto-Submitted header to post-receive-email

13 years agoMerge branch 'as/check-ignore'
Junio C Hamano [Thu, 24 Jan 2013 05:19:10 +0000 (21:19 -0800)]
Merge branch 'as/check-ignore'

Add a new command "git check-ignore" for debugging .gitignore
files.

The variable names may want to get cleaned up but that can be done
in-tree.

* as/check-ignore:
  clean.c, ls-files.c: respect encapsulation of exclude_list_groups
  t0008: avoid brace expansion
  add git-check-ignore sub-command
  setup.c: document get_pathspec()
  add.c: extract new die_if_path_beyond_symlink() for reuse
  add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse
  pathspec.c: rename newly public functions for clarity
  add.c: move pathspec matchers into new pathspec.c for reuse
  add.c: remove unused argument from validate_pathspec()
  dir.c: improve docs for match_pathspec() and match_pathspec_depth()
  dir.c: provide clear_directory() for reclaiming dir_struct memory
  dir.c: keep track of where patterns came from
  dir.c: use a single struct exclude_list per source of excludes

Conflicts:
builtin/ls-files.c
dir.c

13 years agoMerge branch 'rs/clarify-entry-cmp-sslice'
Junio C Hamano [Thu, 24 Jan 2013 05:19:06 +0000 (21:19 -0800)]
Merge branch 'rs/clarify-entry-cmp-sslice'

* rs/clarify-entry-cmp-sslice:
  refs: use strncmp() instead of strlen() and memcmp()

13 years agoMerge branch 'jk/suppress-clang-warning'
Junio C Hamano [Thu, 24 Jan 2013 05:19:00 +0000 (21:19 -0800)]
Merge branch 'jk/suppress-clang-warning'

* jk/suppress-clang-warning:
  fix clang -Wunused-value warnings for error functions

13 years agoMerge branch 'cr/push-force-tag-update'
Junio C Hamano [Thu, 24 Jan 2013 05:16:49 +0000 (21:16 -0800)]
Merge branch 'cr/push-force-tag-update'

Regression fix to stop "git push" complaining "target ref already
exists", when it is not the real reason the command rejected the
request (e.g. non-fast-forward).

* cr/push-force-tag-update:
  push: fix "refs/tags/ hierarchy cannot be updated without --force"

13 years agoMerge branch 'mh/imap-send-shrinkage'
Junio C Hamano [Thu, 24 Jan 2013 05:16:45 +0000 (21:16 -0800)]
Merge branch 'mh/imap-send-shrinkage'

Remove a lot of unused code from "git imap-send".

* mh/imap-send-shrinkage:
  imap-send.c: simplify logic in lf_to_crlf()
  imap-send.c: fold struct store into struct imap_store
  imap-send.c: remove unused field imap_store::uidvalidity
  imap-send.c: use struct imap_store instead of struct store
  imap-send.c: remove unused field imap_store::trashnc
  imap-send.c: remove namespace fields from struct imap
  imap-send.c: remove struct imap argument to parse_imap_list_l()
  imap-send.c: inline parse_imap_list() in parse_list()
  imap-send.c: remove some unused fields from struct store
  imap-send.c: remove struct message
  imap-send.c: remove struct store_conf
  iamp-send.c: remove unused struct imap_store_conf
  imap-send.c: remove struct msg_data
  imap-send.c: remove msg_data::flags, which was always zero

13 years agoMerge branch 'mo/cvs-server-updates'
Junio C Hamano [Thu, 24 Jan 2013 05:16:38 +0000 (21:16 -0800)]
Merge branch 'mo/cvs-server-updates'

Various git-cvsserver updates.

* mo/cvs-server-updates:
  t9402: Use TABs for indentation
  t9402: Rename check.cvsCount and check.list
  t9402: Simplify git ls-tree
  t9402: Add missing &&; Code style
  t9402: No space after IO-redirection
  t9402: Dont use test_must_fail cvs
  t9402: improve check_end_tree() and check_end_full_tree()
  t9402: sed -i is not portable
  cvsserver Documentation: new cvs ... -r support
  cvsserver: add t9402 to test branch and tag refs
  cvsserver: support -r and sticky tags for most operations
  cvsserver: Add version awareness to argsfromdir
  cvsserver: generalize getmeta() to recognize commit refs
  cvsserver: implement req_Sticky and related utilities
  cvsserver: add misc commit lookup, file meta data, and file listing functions
  cvsserver: define a tag name character escape mechanism
  cvsserver: cleanup extra slashes in filename arguments
  cvsserver: factor out git-log parsing logic

13 years agoMerge branch 'jc/makefile-perl-python-path-doc'
Junio C Hamano [Thu, 24 Jan 2013 05:09:23 +0000 (21:09 -0800)]
Merge branch 'jc/makefile-perl-python-path-doc'

* 'jc/makefile-perl-python-path-doc':
  Makefile: add description on PERL/PYTHON_PATH

13 years agoreflog: use parse_config_key in config callback
Jeff King [Wed, 23 Jan 2013 06:27:37 +0000 (01:27 -0500)]
reflog: use parse_config_key in config callback

This doesn't save any lines, but does keep us from doing
error-prone pointer arithmetic with constants.

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agohelp: use parse_config_key for man config
Jeff King [Wed, 23 Jan 2013 06:27:09 +0000 (01:27 -0500)]
help: use parse_config_key for man config

The resulting code ends up about the same length, but it is
a little more self-explanatory. It now explicitly documents
and checks the pre-condition that the incoming var starts
with "man.", and drops the magic offset "4".

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agosubmodule: simplify memory handling in config parsing
Jeff King [Wed, 23 Jan 2013 06:26:42 +0000 (01:26 -0500)]
submodule: simplify memory handling in config parsing

We keep a strbuf for the name of the submodule, even though
we only ever add one string to it. Let's just use xmemdupz
instead, which is slightly more efficient and makes it
easier to follow what is going on.

Unfortunately, we still end up having to deal with some
memory ownership issues in some code branches, as we have to
allocate the string in order to do a string list lookup, and
then only sometimes want to hand ownership of that string
over to the string_list. Still, making that explicit in the
code (as opposed to sometimes detaching the strbuf, and then
always releasing it) makes it a little more obvious what is
going on.

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Acked-by: Jens Lehmann <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agosubmodule: use parse_config_key when parsing config
Jeff King [Wed, 23 Jan 2013 06:25:22 +0000 (01:25 -0500)]
submodule: use parse_config_key when parsing config

This makes the code a lot simpler to read by dropping a
whole bunch of constant offsets.

As a bonus, it means we also feed the whole config variable
name to our error functions:

  [before]
  $ git -c submodule.foo.fetchrecursesubmodules=bogus checkout
  fatal: bad foo.fetchrecursesubmodules argument: bogus

  [after]
  $ git -c submodule.foo.fetchrecursesubmodules=bogus checkout
  fatal: bad submodule.foo.fetchrecursesubmodules argument: bogus

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Acked-by: Jens Lehmann <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agol10n: de.po: fix some minor issues
Ralf Thielow [Mon, 21 Jan 2013 18:35:12 +0000 (19:35 +0100)]
l10n: de.po: fix some minor issues

This fixes some minor issues and improves the
German translation a bit. The following things
were changed:
- use complete sentences in option related messages
- translate "use" consistently as "verwendet"
- don't translate "make sense" as "macht Sinn"

Signed-off-by: Ralf Thielow <redacted>
Acked-by: Thomas Rast <redacted>
13 years agouserdiff: drop parse_driver function
Jeff King [Wed, 23 Jan 2013 06:25:07 +0000 (01:25 -0500)]
userdiff: drop parse_driver function

When we parse userdiff config, we generally assume that

  diff.name.key

will affect the "key" value of the "name" driver. However,
without confirming that the key is a valid userdiff key, we
may accidentally conflict with the ancient "diff.color.*"
namespace. The current code is careful not to even create a
driver struct if we do not see a key that is known by the
diff-driver code.

However, this carefulness is unnecessary; the default driver
with no keys set behaves exactly the same as having no
driver at all. We can simply set up the driver struct as
soon as we see we have a config key that looks like a
driver. This makes the code a bit more readable.

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoconvert some config callbacks to parse_config_key
Jeff King [Wed, 23 Jan 2013 06:24:23 +0000 (01:24 -0500)]
convert some config callbacks to parse_config_key

These callers can drop some inline pointer arithmetic and
magic offset constants, making them more readable and less
error-prone (those constants had to match the lengths of
strings, but there is no automatic verification of that
fact).

The "ep" pointer (presumably for "end pointer"), which
points to the final key segment of the config variable, is
given the more standard name "key" to describe its function
rather than its derivation.

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoarchive-tar: use parse_config_key when parsing config
Jeff King [Wed, 23 Jan 2013 06:23:27 +0000 (01:23 -0500)]
archive-tar: use parse_config_key when parsing config

This is fewer lines of code, but more importantly, fixes a
bogus pointer offset. We are looking for "tar." in the
section, but later assume that the dot we found is at offset
9, not 3. This is a holdover from an earlier iteration of
767cf45 which called the section "tarfilter".

As a result, we could erroneously reject some filters with
dots in their name, as well as read uninitialized memory.

Reported by (and test by) René Scharfe.

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoconfig: add helper function for parsing key names
Jeff King [Wed, 23 Jan 2013 06:23:05 +0000 (01:23 -0500)]
config: add helper function for parsing key names

The config callback functions get keys of the general form:

  section.subsection.key

(where the subsection may be contain arbitrary data, or may
be missing). For matching keys without subsections, it is
simple enough to call "strcmp". Matching keys with
subsections is a little more complicated, and each callback
does it in an ad-hoc way, usually involving error-prone
pointer arithmetic.

Let's provide a helper that keeps the pointer arithmetic all
in one place.

Signed-off-by: Jeff King <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge git://ozlabs.org/~paulus/gitk
Junio C Hamano [Wed, 23 Jan 2013 16:35:03 +0000 (08:35 -0800)]
Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
  gitk: Display important heads even when there are many
  gitk: Improve display of list of nearby tags and heads
  gitk: Fix display of branch names on some commits
  gitk: Update Swedish translation (296t)
  gitk: When searching, only highlight files when in Patch mode
  gitk: Fix error message when clicking on a connecting line
  gitk: Fix crash when not using themed widgets
  gitk: Use bindshiftfunctionkey to bind Shift-F5
  gitk: Refactor code for binding modified function keys
  gitk: Work around empty back and forward images when buttons are disabled
  gitk: Highlight first search result immediately on incremental search
  gitk: Highlight current search hit in orange
  gitk: Synchronize highlighting in file view when scrolling diff

13 years agoMerge branch 'jc/merge-blobs'
Junio C Hamano [Tue, 22 Jan 2013 18:48:20 +0000 (10:48 -0800)]
Merge branch 'jc/merge-blobs'

* jc/merge-blobs:
  Makefile: Replace merge-file.h with merge-blobs.h in LIB_H

13 years agoMakefile: Replace merge-file.h with merge-blobs.h in LIB_H
Ramsay Jones [Tue, 22 Jan 2013 16:47:47 +0000 (16:47 +0000)]
Makefile: Replace merge-file.h with merge-blobs.h in LIB_H

Commit fa2364ec ("Which merge_file() function do you mean?", 06-12-2012)
renamed the files merge-file.[ch] to merge-blobs.[ch], but forgot to
rename the header file in the definition of the LIB_H macro.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Tue, 22 Jan 2013 18:01:05 +0000 (10:01 -0800)]
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge branch 'mz/reset-misc'
Junio C Hamano [Tue, 22 Jan 2013 17:36:13 +0000 (09:36 -0800)]
Merge branch 'mz/reset-misc'

Various 'reset' optimizations and clean-ups, followed by a change
to allow "git reset" to work even on an unborn branch.

* mz/reset-misc:
  reset: update documentation to require only tree-ish with paths
  reset [--mixed]: use diff-based reset whether or not pathspec was given
  reset: allow reset on unborn branch
  reset $sha1 $pathspec: require $sha1 only to be treeish
  reset.c: inline update_index_refresh()
  reset.c: finish entire cmd_reset() whether or not pathspec is given
  reset [--mixed]: only write index file once
  reset.c: move lock, write and commit out of update_index_refresh()
  reset.c: move update_index_refresh() call out of read_from_tree()
  reset.c: replace switch by if-else
  reset: avoid redundant error message
  reset --keep: only write index file once
  reset.c: share call to die_if_unmerged_cache()
  reset.c: extract function for updating {ORIG_,}HEAD
  reset.c: remove unnecessary variable 'i'
  reset.c: extract function for parsing arguments
  reset: don't allow "git reset -- $pathspec" in bare repo
  reset.c: pass pathspec around instead of (prefix, argv) pair
  reset $pathspec: exit with code 0 if successful
  reset $pathspec: no need to discard index

13 years agoMerge branch 'nd/fix-directory-attrs-off-by-one'
Junio C Hamano [Tue, 22 Jan 2013 17:34:28 +0000 (09:34 -0800)]
Merge branch 'nd/fix-directory-attrs-off-by-one'

Fix performance regression introduced by an earlier change to let
attributes apply to directories.

Needs to be merged to maint, as 94bc671a was merged there already.

* nd/fix-directory-attrs-off-by-one:
  attr: avoid calling find_basename() twice per path
  attr: fix off-by-one directory component length calculation

13 years agoEnable minimal stat checking
Robin Rosenberg [Tue, 22 Jan 2013 07:49:22 +0000 (08:49 +0100)]
Enable minimal stat checking

Specifically the fields uid, gid, ctime, ino and dev are set to zero
by JGit. Other implementations, eg. Git in cygwin are allegedly also
somewhat incompatible with Git For Windows and on *nix platforms
the resolution of the timestamps may differ.

Any stat checking by git will then need to check content, which may
be very slow, particularly on Windows. Since mtime and size
is typically enough we should allow the user to tell git to avoid
checking these fields if they are set to zero in the index.

This change introduces a core.checkstat config option where the
the user can select to check all fields (default), or just size
and the whole second part of mtime (minimal).

Signed-off-by: Robin Rosenberg <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge branch 'pw/p4-branch-fixes'
Junio C Hamano [Tue, 22 Jan 2013 04:15:44 +0000 (20:15 -0800)]
Merge branch 'pw/p4-branch-fixes'

Fix "git p4" around branch handling.

* pw/p4-branch-fixes:
  git p4: fix submit when no master branch
  git p4 test: keep P4CLIENT changes inside subshells
  git p4: fix sync --branch when no master branch
  git p4: fail gracefully on sync with no master branch
  git p4: rearrange self.initialParent use
  git p4: allow short ref names to --branch
  git p4 doc: fix branch detection example
  git p4: clone --branch should checkout master
  git p4: verify expected refs in clone --bare test
  git p4: create p4/HEAD on initial clone
  git p4: inline listExistingP4GitBranches
  git p4: add comments to p4BranchesInGit
  git p4: rearrange and simplify hasOrigin handling
  git p4: test sync/clone --branch behavior

13 years agoMerge branch 'mh/remote-hg-mode-bits-fix'
Junio C Hamano [Tue, 22 Jan 2013 04:15:40 +0000 (20:15 -0800)]
Merge branch 'mh/remote-hg-mode-bits-fix'

Update to the Hg remote helper (in contrib/).

* mh/remote-hg-mode-bits-fix:
  remote-hg: fix handling of file perms when pushing

13 years agoMerge branch 'fc/remote-hg-fixup-url'
Junio C Hamano [Tue, 22 Jan 2013 04:15:32 +0000 (20:15 -0800)]
Merge branch 'fc/remote-hg-fixup-url'

Update to the Hg remote helper (in contrib/).

* fc/remote-hg-fixup-url:
  remote-hg: store converted URL

13 years agoMerge branch 'zk/clean-report-failure'
Junio C Hamano [Tue, 22 Jan 2013 04:15:24 +0000 (20:15 -0800)]
Merge branch 'zk/clean-report-failure'

"git clean" states what it is going to remove and then goes on to
remove it, but sometimes it only discovers things that cannot be
removed after recursing into a directory, which makes the output
confusing and even wrong.

* zk/clean-report-failure:
  git-clean: Display more accurate delete messages

13 years agoMerge branch 'ph/rebase-preserve-all-merges'
Junio C Hamano [Tue, 22 Jan 2013 04:15:15 +0000 (20:15 -0800)]
Merge branch 'ph/rebase-preserve-all-merges'

An earlier change to add --keep-empty option broke "git rebase
--preserve-merges" and lost merge commits that end up being the
same as its parent.

* ph/rebase-preserve-all-merges:
  rebase --preserve-merges: keep all merge commits including empty ones

13 years agoMerge branch 'nd/clone-no-separate-git-dir-with-bare'
Junio C Hamano [Tue, 22 Jan 2013 04:15:07 +0000 (20:15 -0800)]
Merge branch 'nd/clone-no-separate-git-dir-with-bare'

Forbid a useless combination of options to "git clone".

* nd/clone-no-separate-git-dir-with-bare:
  clone: forbid --bare --separate-git-dir <dir>

13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 22 Jan 2013 01:16:16 +0000 (17:16 -0800)]
Merge branch 'maint'

* maint:
  git-for-each-ref.txt: 'raw' is a supported date format

13 years agot0050: Use TAB for indentation
Torsten Bögershausen [Mon, 21 Jan 2013 16:46:31 +0000 (17:46 +0100)]
t0050: Use TAB for indentation

Use one TAB for indentation and remove empty lines

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agot0050: honor CASE_INSENSITIVE_FS in add (with different case)
Torsten Bögershausen [Mon, 21 Jan 2013 16:46:15 +0000 (17:46 +0100)]
t0050: honor CASE_INSENSITIVE_FS in add (with different case)

The test case "add (with different case)" indicates a
known breakage when run on a case insensitive file system.

The test is invalid for case sensitive file system, it will always fail.

Check the precondition CASE_INSENSITIVE_FS before running it.

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agot0050: known breakage vanished in merge (case change)
Torsten Bögershausen [Mon, 21 Jan 2013 16:45:43 +0000 (17:45 +0100)]
t0050: known breakage vanished in merge (case change)

This test case has passed since this commit:

  commit 0047dd2fd1fc1980913901c5fa098357482c2842
  Author: Steffen Prohaska <redacted>
  Date:   Thu May 15 07:19:54 2008 +0200

    t0050: Fix merge test on case sensitive file systems

Remove the known breakage by using test_expect_success

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogrep: avoid accepting ambiguous revision
Nguyễn Thái Ngọc Duy [Mon, 21 Jan 2013 13:00:49 +0000 (20:00 +0700)]
grep: avoid accepting ambiguous revision

Unlike other commands that take both revs and pathspecs without "--"
disamiguators only when the boundary is clear, "git grep" treated
what can be interpreted as a rev as-is, without making sure that it
could also have meant a pathspec.  E.g.

    $ git grep -e foo master

when 'master' is in the working tree, should have triggered an
ambiguity error, but it didn't, and searched in the tree of the
commit named by 'master'.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoUpdate :/abc ambiguity check
Nguyễn Thái Ngọc Duy [Mon, 21 Jan 2013 13:00:48 +0000 (20:00 +0700)]
Update :/abc ambiguity check

:/abc may mean two things:

- as a revision, it means the revision that has "abc" in commit
  message.

- as a pathpec, it means "abc" from root.

Currently we see ":/abc" as a rev (most of the time), but never see it
as a pathspec even if "abc" exists and "git log :/abc" will gladly
take ":/abc" as rev even it's ambiguous. This patch makes it:

- ambiguous when "abc" exists on worktree
- a rev if abc does not exist on worktree
- a path if abc is not found in any commits (although better use
  "--" to avoid ambiguation because searching through commit DAG is
  expensive)

A plus from this patch is, because ":/" never matches anything as a
rev, it is never considered a valid rev and because root directory
always exists, ":/" is always unambiguously seen as a pathspec.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agogit-for-each-ref.txt: 'raw' is a supported date format
John Keeping [Mon, 21 Jan 2013 16:22:06 +0000 (16:22 +0000)]
git-for-each-ref.txt: 'raw' is a supported date format

Commit 7dff9b3 (Support 'raw' date format) added a raw date format.
Update the git-for-each-ref documentation to include this.

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
13 years agoUpdate draft release notes to 1.8.2
Junio C Hamano [Mon, 21 Jan 2013 01:28:13 +0000 (17:28 -0800)]
Update draft release notes to 1.8.2

Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 21 Jan 2013 01:27:27 +0000 (17:27 -0800)]
Merge branch 'maint'

13 years agoStart preparing for 1.8.1.2
Junio C Hamano [Mon, 21 Jan 2013 01:26:04 +0000 (17:26 -0800)]
Start preparing for 1.8.1.2

Signed-off-by: Junio C Hamano <redacted>
13 years agoMerge branch 'nz/send-email-headers-are-case-insensitive' into maint
Junio C Hamano [Mon, 21 Jan 2013 01:22:49 +0000 (17:22 -0800)]
Merge branch 'nz/send-email-headers-are-case-insensitive' into maint

When users spell "cc:" in lowercase in the fake "header" in the
trailer part, "git send-email" failed to pick up the addresses from
there. As e-mail headers field names are case insensitive, this
script should follow suit and treat "cc:" and "Cc:" the same way.

* nz/send-email-headers-are-case-insensitive:
  git-send-email: treat field names as case-insensitively

13 years agoMerge branch 'rs/zip-with-uncompressed-size-in-the-header' into maint
Junio C Hamano [Mon, 21 Jan 2013 01:22:27 +0000 (17:22 -0800)]
Merge branch 'rs/zip-with-uncompressed-size-in-the-header' into maint

"git archive" did not record uncompressed size in the header when
streaming a zip archive, which confused some implementations of
unzip.

* rs/zip-with-uncompressed-size-in-the-header:
  archive-zip: write uncompressed size into header even with streaming

13 years agoMerge branch 'rs/zip-tests' into maint
Junio C Hamano [Mon, 21 Jan 2013 01:22:22 +0000 (17:22 -0800)]
Merge branch 'rs/zip-tests' into maint

* rs/zip-tests:
  t5003: check if unzip supports symlinks
  t5000, t5003: move ZIP tests into their own script
  t0024, t5000: use test_lazy_prereq for UNZIP
  t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead

13 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 21 Jan 2013 01:08:46 +0000 (17:08 -0800)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: do not escape certain characters in paths

13 years agoMerge branch 'rt/commit-cleanup-config'
Junio C Hamano [Mon, 21 Jan 2013 01:07:04 +0000 (17:07 -0800)]
Merge branch 'rt/commit-cleanup-config'

Add a configuration variable to set default clean-up mode other
than "strip".

* rt/commit-cleanup-config:
  commit: make default of "cleanup" option configurable

13 years agoMerge branch 'ap/log-mailmap'
Junio C Hamano [Mon, 21 Jan 2013 01:06:52 +0000 (17:06 -0800)]
Merge branch 'ap/log-mailmap'

Teach commands in the "log" family to optionally pay attention to
the mailmap.

* ap/log-mailmap:
  log --use-mailmap: optimize for cases without --author/--committer search
  log: add log.mailmap configuration option
  log: grep author/committer using mailmap
  test: add test for --use-mailmap option
  log: add --use-mailmap option
  pretty: use mailmap to display username and email
  mailmap: add mailmap structure to rev_info and pp
  mailmap: simplify map_user() interface
  mailmap: remove email copy and length limitation
  Use split_ident_line to parse author and committer
  string-list: allow case-insensitive string list

git clone https://git.99rst.org/PROJECT