git.git
12 years agoremote-bzr: add support to push merges
Felipe Contreras [Wed, 1 May 2013 01:09:57 +0000 (20:09 -0500)]
remote-bzr: add support to push merges

In order to do that, we need to store the marks of every file, so that
they can be fetched when needed. Unfortunately we can't tell bazaar that
nothing changed, we need to send the data so that it can figure it out
by itself.

And since it will be requesting a bunch of information by the file_id,
it's better to have a helper dict (rev_files), so that we can fetch it
quickly.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: always try to update the worktree
Felipe Contreras [Wed, 1 May 2013 01:09:56 +0000 (20:09 -0500)]
remote-bzr: always try to update the worktree

And fail properly when we can't.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: fix order of locking in CustomTree
Felipe Contreras [Wed, 1 May 2013 01:09:55 +0000 (20:09 -0500)]
remote-bzr: fix order of locking in CustomTree

It doesn't seem to make any difference, but revision_tree() requires a
lock.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: delay blob fetching until the very end
Felipe Contreras [Wed, 1 May 2013 01:09:54 +0000 (20:09 -0500)]
remote-bzr: delay blob fetching until the very end

Might be more efficient, but the real reason to use the marks will be
revealed in upcoming patches.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: cleanup CustomTree
Felipe Contreras [Wed, 1 May 2013 01:09:53 +0000 (20:09 -0500)]
remote-bzr: cleanup CustomTree

This code was not used at all.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agounpack_entry: avoid freeing objects in base cache
Thomas Rast [Tue, 30 Apr 2013 12:53:06 +0000 (14:53 +0200)]
unpack_entry: avoid freeing objects in base cache

In the !delta_data error path of unpack_entry(), we run free(base).
This became a window for use-after-free() in abe601b (sha1_file:
remove recursion in unpack_entry, 2013-03-27), as follows:

Before abe601b, we got the 'base' from cache_or_unpack_entry(..., 0);
keep_cache=0 tells it to also remove that entry.  So the 'base' is at
this point not cached, and freeing it in the error path is the right
thing.

After abe601b, the structure changed: we use a three-phase approach
where phase 1 finds the innermost base or a base that is already in
the cache.  In phase 3 we therefore know that all bases we unpack are
not part of the delta cache yet.  (Observe that we pop from the cache
in phase 1, so this is also true for the very first base.)  So we make
no further attempts to look up the bases in the cache, and just call
add_delta_base_cache() on every base object we have assembled.

But the !delta_data error path remained unchanged, and now calls
free() on a base that has already been entered in the cache.  This
means that there is a use-after-free if we later use the same base
again.

So remove that free(); we are still going to use that data.

Reported-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agol10n: Update Swedish translation (2080t0f0u)
Peter Krefting [Tue, 30 Apr 2013 11:30:21 +0000 (12:30 +0100)]
l10n: Update Swedish translation (2080t0f0u)

Signed-off-by: Peter Krefting <redacted>
12 years agol10n: git.pot: v1.8.3 round 2 (44 new, 12 removed)
Jiang Xin [Tue, 30 Apr 2013 00:31:19 +0000 (08:31 +0800)]
l10n: git.pot: v1.8.3 round 2 (44 new, 12 removed)

Generate po/git.pot from v1.8.3-rc0-19-g7e6a0 for git v1.8.3
l10n round 2.

Signed-off-by: Jiang Xin <redacted>
12 years agot0008: use named pipe (FIFO) to test check-ignore streaming
Adam Spiers [Mon, 29 Apr 2013 22:55:25 +0000 (23:55 +0100)]
t0008: use named pipe (FIFO) to test check-ignore streaming

sleeps in the check-ignore test suite are not ideal since they can
fail when the system is under load, or when a tool like valgrind is
used which drastically alters the timing.  Therefore we replace them
with a more robust solution using a named pipe (FIFO).

Thanks to Jeff King for coming up with the redirection wizardry
required to make this work.

http://article.gmane.org/gmane.comp.version-control.git/220916

Signed-off-by: Adam Spiers <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agotest output: respect $TEST_OUTPUT_DIRECTORY
John Keeping [Mon, 29 Apr 2013 18:16:21 +0000 (19:16 +0100)]
test output: respect $TEST_OUTPUT_DIRECTORY

Most test results go in $TEST_OUTPUT_DIRECTORY, but the output files for
tests run with --tee or --valgrind just use bare "test-results".
Changes these so that they do respect $TEST_OUTPUT_DIRECTORY.

As a result of this, the valgrind/analyze.sh script may no longer
inspect the correct files so it is also updated to respect
$TEST_OUTPUT_DIRECTORY by adding it to GIT-BUILD-OPTIONS.  This may be a
regression for people who have TEST_OUTPUT_DIRECTORY in their config.mak
but want to override it in the environment, but this change merely
brings it into line with GIT_TEST_OPTS which already cannot be
overridden if it is specified in config.mak.

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit-completion.bash: add remote.pushdefault to config list
Ramkumar Ramachandra [Mon, 29 Apr 2013 12:49:41 +0000 (18:19 +0530)]
git-completion.bash: add remote.pushdefault to config list

224c2171 (remote.c: introduce remote.pushdefault, 2013-04-02)
introduced the remote.pushdefault configuration variable, but forgot
to teach git-completion.bash about it.  Fix this.

Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit-completion.bash: add branch.*.pushremote to config list
Ramkumar Ramachandra [Mon, 29 Apr 2013 12:49:40 +0000 (18:19 +0530)]
git-completion.bash: add branch.*.pushremote to config list

9f765ce (remote.c: introduce branch.<name>.pushremote, 2013-04-02)
introduced the configuration variable branch.*.pushremote, but forgot
to teach git-completion.bash about it.  Fix this.

Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'maint'
Junio C Hamano [Mon, 29 Apr 2013 16:57:38 +0000 (09:57 -0700)]
Merge branch 'maint'

* maint:
  complete: zsh: use zsh completion for the main cmd
  complete: zsh: trivial simplification
  git-completion.bash: complete branch.*.rebase as boolean
  git-completion.bash: add diff.submodule to config list
  git-completion.bash: lexical sorting for diff.statGraphWidth

12 years agoMerge branch 'fc/zsh-completion' into maint
Junio C Hamano [Mon, 29 Apr 2013 16:52:18 +0000 (09:52 -0700)]
Merge branch 'fc/zsh-completion' into maint

* fc/zsh-completion:
  complete: zsh: use zsh completion for the main cmd
  complete: zsh: trivial simplification

12 years agocomplete: zsh: use zsh completion for the main cmd
Felipe Contreras [Sat, 27 Apr 2013 20:34:06 +0000 (15:34 -0500)]
complete: zsh: use zsh completion for the main cmd

So that we can have a nice zsh completion output:

% git <tab>
add       -- add file contents to the index
bisect    -- find by binary search the change that introduced a bug
branch    -- list, create, or delete branches
checkout  -- checkout a branch or paths to the working tree
clone     -- clone a repository into a new directory
commit    -- record changes to the repository
diff      -- show changes between commits, commit and working tree, etc
fetch     -- download objects and refs from another repository
grep      -- print lines matching a pattern
init      -- create an empty Git repository or reinitialize an existing one
log       -- show commit logs
merge     -- join two or more development histories together
mv        -- move or rename a file, a directory, or a symlink
pull      -- fetch from and merge with another repository or a local branch
push      -- update remote refs along with associated objects
rebase    -- forward-port local commits to the updated upstream head
reset     -- reset current HEAD to the specified state
rm        -- remove files from the working tree and from the index
show      -- show various types of objects
status    -- show the working tree status
tag       -- create, list, delete or verify a tag object signed with GPG

And other niceties, like 'git --git-dir=<tab>' showing only directories.

For the rest, the bash completion stuff is still used.

Also, add my copyright, since this more than a thin wrapper.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocomplete: zsh: trivial simplification
Felipe Contreras [Sat, 27 Apr 2013 20:34:05 +0000 (15:34 -0500)]
complete: zsh: trivial simplification

There should be no functional changes.

The only reason I wrapped this code around a sub-function is because zsh
did the same in it's bashcompinit script in order to declare the special
variable 'words' as hidden, but only in this context.

There's no need for that any more since we access __git_main directly,
so 'words' is not modified, so there's no need for the sub-function.

In zsh mode the array indexes are different though.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit-completion.bash: complete branch.*.rebase as boolean
Ramkumar Ramachandra [Mon, 29 Apr 2013 12:49:39 +0000 (18:19 +0530)]
git-completion.bash: complete branch.*.rebase as boolean

6fac1b83 (completion: add missing config variables, 2009-06-29) added
"rebase" to the list of completions for "branch.*.*", but forgot to
specify completions for the values that this configuration variable
can take (namely "false" and "true").  Fix this.

Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit-completion.bash: add diff.submodule to config list
Ramkumar Ramachandra [Mon, 29 Apr 2013 12:49:38 +0000 (18:19 +0530)]
git-completion.bash: add diff.submodule to config list

c47ef57 (diff: introduce diff.submodule configuration variable,
2012-11-13) introduced the diff.submodule configuration variable, but
forgot to teach git-completion.bash about it.  Fix this.

Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit-completion.bash: lexical sorting for diff.statGraphWidth
Ramkumar Ramachandra [Mon, 29 Apr 2013 12:49:37 +0000 (18:19 +0530)]
git-completion.bash: lexical sorting for diff.statGraphWidth

df44483a (diff --stat: add config option to limit graph width,
2012-03-01) added the option diff.startGraphWidth to the list of
configuration variables in git-completion.bash, but failed to notice
that the list is sorted alphabetically.  Move it to its rightful place
in the list.

Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoGit.pm: call tempfile from File::Temp as a regular function
H. Merijn Brand [Mon, 29 Apr 2013 08:09:57 +0000 (01:09 -0700)]
Git.pm: call tempfile from File::Temp as a regular function

We call File::Temp's "tempfile" function as a class method, but it was
never designed to be called this way. Older versions seemed to
tolerate it, but as of File::Temp 0.23, it blows up like this:

  $ git svn fetch
  'tempfile' can't be called as a method at .../Git.pm line 1117.

Fix it by calling it as a regular function, just inside the File::Temp
namespace.

Signed-off-by: H. Merijn Brand <redacted>
Helped-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoupload-pack: ignore 'shallow' lines with unknown obj-ids
Michael Heemskerk [Mon, 29 Apr 2013 05:32:04 +0000 (22:32 -0700)]
upload-pack: ignore 'shallow' lines with unknown obj-ids

When the client sends a 'shallow' line for an object that the server does
not have, the server currently dies with the error: "did not find object
for shallow <obj-id>".  The client may have truncated the history at
the commit by fetching shallowly from a different server, or the commit
may have been garbage collected by the server. In either case, this
unknown commit is not relevant for calculating the pack that is to be
sent and can be safely ignored, and it is not used when recomputing where
the updated history of the client is cauterised.

The documentation in technical/pack-protocol.txt has been updated to
remove the restriction that "Clients MUST NOT mention an obj-id which it
does not know exists on the server". This requirement is not realistic
because clients cannot know whether an object has been garbage collected
by the server.

Signed-off-by: Michael Heemskerk <redacted>
Reviewed-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit-remote-testgit: build it to run under $SHELL_PATH
Junio C Hamano [Fri, 26 Apr 2013 23:30:40 +0000 (16:30 -0700)]
git-remote-testgit: build it to run under $SHELL_PATH

Just like all the other shell scripts, replace the shebang line to
make sure it runs under the shell the user specified.

As this no longer depends on bashisms, t5801 does not have to say
bash must be available somewhere on the system.

Signed-off-by: Junio C Hamano <redacted>
12 years agogit-remote-testgit: further remove some bashisms
Johannes Sixt [Thu, 25 Apr 2013 10:59:41 +0000 (12:59 +0200)]
git-remote-testgit: further remove some bashisms

Signed-off-by: Johannes Sixt <redacted>
12 years agoMerge branch 'maint'
Junio C Hamano [Sun, 28 Apr 2013 21:47:24 +0000 (14:47 -0700)]
Merge branch 'maint'

* maint:
  documentation: trivial whitespace cleanups
  t/Makefile: remove smoke test targets

12 years agodocumentation: trivial whitespace cleanups
Felipe Contreras [Sat, 27 Apr 2013 22:00:07 +0000 (17:00 -0500)]
documentation: trivial whitespace cleanups

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agot/Makefile: remove smoke test targets
John Keeping [Fri, 26 Apr 2013 17:58:24 +0000 (18:58 +0100)]
t/Makefile: remove smoke test targets

Commit d24fbca (Remove Git's support for smoke testing - 2011-12-23)
removed the smoke test support from the test suite but it was
re-added by commit 342e9ef (Introduce a performance testing
framework - 2012-02-17).  This appears to be the result of a
mis-rebase, since re-adding the smoke testing infrastructure does
not relate to the subject of that commit.

The current 'smoke' target is broken since the 'harness' script it
uses no longer exists, so just reapply this section of commit d24fbca
and remove all of the smoke testing section in the makefile.

Signed-off-by: John Keeping <redacted>
Acked-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agosparse: Fix mingw_main() argument number/type errors
Ramsay Jones [Sat, 27 Apr 2013 19:19:47 +0000 (20:19 +0100)]
sparse: Fix mingw_main() argument number/type errors

Sparse issues 68 errors (two errors for each main() function) such
as the following:

      SP git.c
  git.c:510:5: error: too many arguments for function mingw_main
  git.c:510:5: error: symbol 'mingw_main' redeclared with different type \
    (originally declared at git.c:510) - different argument counts

The errors are caused by the 'main' macro used by the MinGW build
to provide a replacement main() function. The original main function
is effectively renamed to 'mingw_main' and is called from the new
main function. The replacement main is used to execute certain actions
common to all git programs on MinGW (e.g. ensure the standard I/O
streams are in binary mode).

In order to suppress the errors, we change the macro to include the
parameters in the declaration of the mingw_main function.

Unfortunately, this change provokes both sparse and gcc to complain
about 9 calls to mingw_main(), such as the following:

      CC git.o
  git.c: In function 'main':
  git.c:510: warning: passing argument 2 of 'mingw_main' from \
    incompatible pointer type
  git.c:510: note: expected 'const char **' but argument is of \
    type 'char **'

In order to suppress these warnings, since both of the main
functions need to be declared with the same prototype, we
change the declaration of the 9 main functions, thus:

    int main(int argc, char **argv)

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/mingw.c: Fix some sparse warnings
Ramsay Jones [Sat, 27 Apr 2013 19:18:55 +0000 (20:18 +0100)]
compat/mingw.c: Fix some sparse warnings

Sparse issues the following warnings:

        SP compat/mingw.c
    compat/mingw.c:795:3: warning: symbol 'pinfo_t' was not declared. \
        Should it be static?
    compat/mingw.c:796:16: warning: symbol 'pinfo' was not declared. \
        Should it be static?
    compat/mingw.c:797:18: warning: symbol 'pinfo_cs' was not declared. \
        Should it be static?
    compat/mingw.c:1207:23: warning: Using plain integer as NULL pointer

In 'pinfo_t' variable, defined on line 795, seems to have been a
mistake (a missing typedef keyword?), so we simply remove it.

The 'pinfo' variable does not require more than file scope, so we
simply add the static modifier to the declaration.

The 'pinfo_cs' variable, in contrast, requires initialisation in the
mingw replacement main() function, so we add an extern declaration to
the compat/mingw.h header file.

The remaining warning is suppressed by replacing the rhs of the
pointer assignment with the NULL pointer literal.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/win32mmap.c: Fix some sparse warnings
Ramsay Jones [Sat, 27 Apr 2013 19:18:03 +0000 (20:18 +0100)]
compat/win32mmap.c: Fix some sparse warnings

Sparse issues two 'Using plain integer as NULL pointer' warnings
against the call to the CreateFileMapping() function. The warnings
relate to the second and sixth parameters, which both have pointer
type. In order to suppress the warnings, we simply pass the NULL
pointer, rather than '0', to those parameters in the function call.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/poll/poll.c: Fix a sparse warning
Ramsay Jones [Sat, 27 Apr 2013 19:17:14 +0000 (20:17 +0100)]
compat/poll/poll.c: Fix a sparse warning

Sparse issues an 'Using plain integer as NULL pointer' warning when
passing the constant '0' as the second parameter in the call to the
WSAEventSelect() function. The function parameter has a pointer type
(WSAEVENT, aka HANDLE, aka void *) so that, in order to suppress the
warning, we simply pass NULL for that parameter in the function call
expression.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/win32/pthread.c: Fix a sparse warning
Ramsay Jones [Sat, 27 Apr 2013 19:16:28 +0000 (20:16 +0100)]
compat/win32/pthread.c: Fix a sparse warning

Sparse issues a 'Using plain integer as NULL pointer' warning when
initializing an pthread_t structure with an '{ 0 }' initializer.
The first field of the pthread_t structure has type HANDLE (void *),
so in order to suppress the warning, we replace the initializer
expression with '{ NULL }'.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/unsetenv.c: Fix a sparse warning
Ramsay Jones [Sat, 27 Apr 2013 19:15:38 +0000 (20:15 +0100)]
compat/unsetenv.c: Fix a sparse warning

The gitunsetenv function includes an (redundant) declaration of the
'environ' symbol, which is a pointer to the table of environment
variables. Unfortunately, on MinGW, this provokes sparse to issue
the following warning:

    compat/unsetenv.c:5:20: warning: non-ANSI function declaration of \
    function '__p__environ'

On MinGW, the <stdlib.h> header defines the 'environ' symbol as a
preprocessor macro (via _environ) which obtains the environ table
pointer via a call to the __p__environ() function.

In order to suppress the warning, we simply remove the redundant
declaration of the 'environ' symbol, since the symbol is already
declared correctly in <stdlib.h> (included via git-compat-util.h).

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/nedmalloc: Fix compiler warnings on linux
Ramsay Jones [Sat, 27 Apr 2013 18:46:17 +0000 (19:46 +0100)]
compat/nedmalloc: Fix compiler warnings on linux

On linux, when the build variable USE_NED_ALLOCATOR is set, gcc
issues the following warnings:

    In file included from compat/nedmalloc/nedmalloc.c:63:
    .../malloc.c.h: In function 'mmap_resize':
    .../malloc.c.h:3762: warning: implicit declaration of function 'mremap'
    .../malloc.c.h: In function 'sys_trim':
    .../malloc.c.h:4195: warning: comparison between pointer and integer

The warnings are caused by the <sys/mman.h> header not enabling the
(conditional) declaration of the mremap() function.  The declaration
can be enabled by defining the _GNU_SOURCE symbol prior to including
certain system header files. In particular, it may not be sufficient
to simply define _GNU_SOURCE just prior to including the <sys/mman.h>
header. (e.g. defining the symbol after including <sys/types.h> will
be completely ineffective.)

In order to suppress the warnings, we define the _GNU_SOURCE symbol
at the start of the malloc.c.h header file.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/nedmalloc: Fix some sparse warnings
Ramsay Jones [Sat, 27 Apr 2013 18:45:02 +0000 (19:45 +0100)]
compat/nedmalloc: Fix some sparse warnings

Sparse issues many "Using plain integer as NULL pointer" warnings
while checking nedmalloc.c (at least 98 such warnings before giving
up due to "too many warnings"). In addition, sparse issues some
"non-ANSI function declaration" type warnings for the symbols
'win32_getcurrentthreadid', 'malloc_stats' and 'malloc_footprint'.

In order to suppress the NULL pointer warnings, rather than replace
all uses of '0' as a null pointer representation with NULL, we add
-Wno-non-pointer-null to SPARSE_FLAGS while checking nedmalloc.c.

In order to suppress the "non-ANSI function declaration" warnings,
we simply include the missing 'empty parameter list' prototype (void)
in the function declarations.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/fnmatch/fnmatch.c: Fix a sparse error
Ramsay Jones [Sat, 27 Apr 2013 18:44:08 +0000 (19:44 +0100)]
compat/fnmatch/fnmatch.c: Fix a sparse error

Sparse issues the following error and warnings:

    SP compat/fnmatch/fnmatch.c
.../fnmatch.c:144:17: warning: Using plain integer as NULL pointer
.../fnmatch.c:238:67: warning: Using plain integer as NULL pointer
.../fnmatch.c:303:40: error: too many arguments for function getenv

The error is caused by the extern declaration for the getenv function
not including the function prototype. Without the prototype, sparse
effectively sees the declaration as 'char *getenv(void)'. In order to
suppress the error, we simply include the function prototype.

In order to suppress the warnings, we include the <stddef.h> header
which provides an appropriate definition of the NULL macro, rather
than using the (inappropriate) default definition at fnmatch.c:132.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompat/regex/regexec.c: Fix some sparse warnings
Ramsay Jones [Sat, 27 Apr 2013 18:43:05 +0000 (19:43 +0100)]
compat/regex/regexec.c: Fix some sparse warnings

Sparse issues an "Using plain integer as NULL pointer" warning along
with two "symbol was not declared. Should it be static?" type warnings
for the 'merge_state_with_log' and 'find_recover_state' functions.

In order to suppress the warnings, we replace the use of '0' as a null
pointer constant with NULL and add the static modifier to the function
definitions.

Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'nd/pretty-formats'
Junio C Hamano [Sun, 28 Apr 2013 19:10:03 +0000 (12:10 -0700)]
Merge branch 'nd/pretty-formats'

* nd/pretty-formats:
  pretty: Fix bug in truncation support for %>, %< and %><

12 years agopretty: Fix bug in truncation support for %>, %< and %><
Ramsay Jones [Sat, 27 Apr 2013 19:43:36 +0000 (20:43 +0100)]
pretty: Fix bug in truncation support for %>, %< and %><

Some systems experience failures in t4205-*.sh (tests 18-20, 27)
which all relate to the use of truncation with the %< padding
placeholder. This capability was added in the commit a7f01c6b
("pretty: support truncating in %>, %< and %><", 19-04-2013).

The truncation support was implemented with the assistance of a
new strbuf function (strbuf_utf8_replace). This function contains
the following code:

       strbuf_attach(sb_src, strbuf_detach(&sb_dst, NULL),
                     sb_dst.len, sb_dst.alloc);

Unfortunately, this code is subject to unspecified behaviour. In
particular, the order of evaluation of the argument expressions
(along with the associated side effects) is not specified by the
C standard. Note that the second argument expression is a call to
strbuf_detach() which, as a side effect, sets the 'len' and 'alloc'
fields of the sb_dst argument to zero. Depending on the order of
evaluation of the argument expressions to the strbuf_attach call,
this can lead to assigning an empty string to 'sb_src'.

In order to remove the undesired behaviour, we replace the above
line of code with:

       strbuf_swap(sb_src, &sb_dst);
       strbuf_release(&sb_dst);

which achieves the desired effect without provoking unspecified
behaviour.

Signed-off-by: Ramsay Jones <redacted>
Acked-by: Duy Nguyen <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'jk/check-corrupt-objects-carefully'
Junio C Hamano [Sun, 28 Apr 2013 18:57:54 +0000 (11:57 -0700)]
Merge branch 'jk/check-corrupt-objects-carefully'

* jk/check-corrupt-objects-carefully:
  clone: Make the 'junk_mode' symbol a file static

12 years agoclone: Make the 'junk_mode' symbol a file static
Ramsay Jones [Sat, 27 Apr 2013 18:39:04 +0000 (19:39 +0100)]
clone: Make the 'junk_mode' symbol a file static

Sparse issues an "'junk_mode' not declared. Should it be static?"
warning. In order to suppress the warning, since this symbol does
not need more than file visibility, we simply add the static
modifier to its declaration.

Signed-off-by: Ramsay Jones <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'jk/merge-tree-added-identically'
Junio C Hamano [Sun, 28 Apr 2013 18:53:57 +0000 (11:53 -0700)]
Merge branch 'jk/merge-tree-added-identically'

off-by-one fix.

* jk/merge-tree-added-identically:
  merge-tree: fix typo in "both changed identically"

12 years agomerge-tree: fix typo in "both changed identically"
John Keeping [Sat, 27 Apr 2013 13:40:33 +0000 (14:40 +0100)]
merge-tree: fix typo in "both changed identically"

Commit aacecc3 (merge-tree: don't print entries that match "local" -
2013-04-07) had a typo causing the "same in both" check to be incorrect
and check if both the base and "their" versions are removed instead of
checking that both the "our" and "their" versions are removed.  Fix
this.

Reported-by: René Scharfe <redacted>
Test-written-by: René Scharfe <redacted>
Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: add missing format-patch options
Felipe Contreras [Sat, 27 Apr 2013 20:17:44 +0000 (15:17 -0500)]
completion: add missing format-patch options

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: remove __git_index_file_list_filter()
Felipe Contreras [Sat, 27 Apr 2013 20:10:07 +0000 (15:10 -0500)]
completion: remove __git_index_file_list_filter()

Refactor the code into the only caller; __git_index_files().

Also, Somehow messing up with the 'path' variable messes up the 'PATH'
variable. So let's not do that.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: add space after completed filename
Felipe Contreras [Sat, 27 Apr 2013 20:10:06 +0000 (15:10 -0500)]
completion: add space after completed filename

Just like before fea16b4 (git-completion.bash: add support for path
completion).

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: add hack to enable file mode in bash < 4
Felipe Contreras [Sat, 27 Apr 2013 20:10:05 +0000 (15:10 -0500)]
completion: add hack to enable file mode in bash < 4

This way we don't need all the compat stuff, different filters, and so
on. Also, now we complete exactly the same in bash 3 and bash 4.

This is the way bash-completion did it for quite some time, when bash 3
was supported. For more information about the hack:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=272660#64

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: refactor __git_complete_index_file()
Felipe Contreras [Sat, 27 Apr 2013 20:10:04 +0000 (15:10 -0500)]
completion: refactor __git_complete_index_file()

The calls to __gitcomp_file() are essentially the same, but with
different prefix.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: refactor diff_index wrappers
Felipe Contreras [Sat, 27 Apr 2013 20:10:03 +0000 (15:10 -0500)]
completion: refactor diff_index wrappers

At the end of the day what we really need is to find out the files that
have been staged, or modified, because those files are the ones that
make sense to pass as arguments to 'git commit'.

We need diff-index to find those out, since 'git ls-files' doesn't do
that.

But we don't need wrappers and wrappers basically identical to the ones
used for 'git ls-files', when we can pretend it receives a --committable
option that would return what we need.

That way, we can remove a bunch of code without any functional changes.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: use __gitcompadd for __gitcomp_file
Felipe Contreras [Sat, 27 Apr 2013 20:10:02 +0000 (15:10 -0500)]
completion: use __gitcompadd for __gitcomp_file

Like the rest of the script does; let's not access COMPREPLY directly.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion; remove unuseful comments
Felipe Contreras [Sat, 27 Apr 2013 20:10:01 +0000 (15:10 -0500)]
completion; remove unuseful comments

The only caller, __git_complete_index_file() doesn't specify any limits
to the options for 'git ls-files', neither should this function.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: document tilde expansion failure in tests
Felipe Contreras [Sat, 27 Apr 2013 20:10:00 +0000 (15:10 -0500)]
completion: document tilde expansion failure in tests

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agocompletion: add file completion tests
Felipe Contreras [Sat, 27 Apr 2013 20:09:59 +0000 (15:09 -0500)]
completion: add file completion tests

The commit fea16b4 (git-completion.bash: add support for path
completion) introduced quite a few changes, without the usual tests.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit-remote-testgit: avoid process substitution
Johannes Sixt [Sat, 27 Apr 2013 19:13:13 +0000 (21:13 +0200)]
git-remote-testgit: avoid process substitution

The implementation of bash on Windows does not offer process substitution.

Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agot/Makefile: fix result handling with TEST_OUTPUT_DIRECTORY
John Keeping [Fri, 26 Apr 2013 18:55:52 +0000 (19:55 +0100)]
t/Makefile: fix result handling with TEST_OUTPUT_DIRECTORY

When TEST_OUTPUT_DIRECTORY is set, the test results will be generated in
"$TEST_OUTPUT_DIRECTORY/test-results", which may not be the same as
"test-results" in t/Makefile.  This causes the aggregate-results target
to fail as it finds no count files.

Fix this by introducing TEST_RESULTS_DIRECTORY and using it wherever
test-results is referenced.

Signed-off-by: John Keeping <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agogit add: -u/-A now affects the entire working tree
Junio C Hamano [Tue, 19 Mar 2013 22:53:17 +0000 (15:53 -0700)]
git add: -u/-A now affects the entire working tree

As promised in 0fa2eb530fb7 (add: warn when -u or -A is used without
pathspec, 2013-01-28), in Git 2.0, "git add -u/-A" that is run
without pathspec in a subdirectory updates all updated paths in the
entire working tree, not just the current directory and its
subdirectories.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoGit 1.8.3-rc0
Junio C Hamano [Fri, 26 Apr 2013 22:45:09 +0000 (15:45 -0700)]
Git 1.8.3-rc0

Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'rr/shortlog-doc'
Junio C Hamano [Fri, 26 Apr 2013 22:28:39 +0000 (15:28 -0700)]
Merge branch 'rr/shortlog-doc'

Update documentation for "log" and "shortlog".

* rr/shortlog-doc:
  builtin/shortlog.c: make usage string consistent with log
  builtin/log.c: make usage string consistent with doc
  git-shortlog.txt: make SYNOPSIS match log, update OPTIONS
  git-log.txt: rewrite note on why "--" may be required
  git-log.txt: generalize <since>..<until>
  git-log.txt: order OPTIONS properly; move <since>..<until>
  revisions.txt: clarify the .. and ... syntax
  git-shortlog.txt: remove (-h|--help) from OPTIONS

12 years agoMerge branch 'th/bisect-skipped-log'
Junio C Hamano [Fri, 26 Apr 2013 22:28:37 +0000 (15:28 -0700)]
Merge branch 'th/bisect-skipped-log'

* th/bisect-skipped-log:
  bisect: Log possibly bad, skipped commits at bisection end

12 years agoMerge branch 'ph/rebase-original'
Junio C Hamano [Fri, 26 Apr 2013 22:28:34 +0000 (15:28 -0700)]
Merge branch 'ph/rebase-original'

* ph/rebase-original:
  rebase: find orig_head unambiguously

12 years agoMerge branch 'jn/glossary-revision'
Junio C Hamano [Fri, 26 Apr 2013 22:28:23 +0000 (15:28 -0700)]
Merge branch 'jn/glossary-revision'

The wording for "revision" in the glossary wanted to say it refers
to "commit (noun) as a concept" but it was badly phrased.

This may need further updates to hint that in contexts where it is
clear, the word may refer to an object name, not necessarily a
commit. But the patch as-is is already an improvement.

* jn/glossary-revision:
  glossary: a revision is just a commit

12 years agoMerge branch 'jc/add-ignore-removal'
Junio C Hamano [Fri, 26 Apr 2013 22:28:09 +0000 (15:28 -0700)]
Merge branch 'jc/add-ignore-removal'

Introduce "--ignore-removal" as a synonym to "--no-all" for "git
add", and improve the 2.0 migration warning with it.

* jc/add-ignore-removal:
  git add: rephrase -A/--no-all warning
  git add: --ignore-removal is a better named --no-all

12 years agoremote-bzr: strip extra newline
Felipe Contreras [Fri, 26 Apr 2013 21:12:38 +0000 (16:12 -0500)]
remote-bzr: strip extra newline

It's added by fast-export, the user didn't type it.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: tell bazaar to be quiet
Felipe Contreras [Fri, 26 Apr 2013 21:12:37 +0000 (16:12 -0500)]
remote-bzr: tell bazaar to be quiet

Otherwise we get notification, progress bars, and what not.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: store converted URL
Felipe Contreras [Fri, 26 Apr 2013 21:12:36 +0000 (16:12 -0500)]
remote-bzr: store converted URL

Bazaar might convert the URL to something more appropriate, like an
absolute path. Lets store that instead of the original URL, which won't
work from a different working directory if it's relative.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-hg: use hashlib instead of hg sha1 util
Felipe Contreras [Fri, 26 Apr 2013 21:12:35 +0000 (16:12 -0500)]
remote-hg: use hashlib instead of hg sha1 util

To be in sync with remote-bzr.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: add support to push URLs
Felipe Contreras [Fri, 26 Apr 2013 21:12:34 +0000 (16:12 -0500)]
remote-bzr: add support to push URLs

Just like in remote-hg.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: fix bad state issue
Felipe Contreras [Fri, 26 Apr 2013 21:12:33 +0000 (16:12 -0500)]
remote-bzr: fix bad state issue

Carried from remote-hg.

The problem reportedly happened after doing a push that fails, the abort
causes the state of remote-hg to go bad, this happens because
remote-hg's marks are not stored, but 'git fast-export' marks are.

Ensure that the marks are _always_ stored.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-hg: remove extra check
Felipe Contreras [Fri, 26 Apr 2013 21:12:32 +0000 (16:12 -0500)]
remote-hg: remove extra check

Not needed since we use xrange ourselves.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-helpers: trivial cleanups
Felipe Contreras [Fri, 26 Apr 2013 21:12:31 +0000 (16:12 -0500)]
remote-helpers: trivial cleanups

No functional changes. Typos, unused variables, redundant operations,
and white-spaces.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'fc/remote-hg'
Junio C Hamano [Fri, 26 Apr 2013 22:19:03 +0000 (15:19 -0700)]
Merge branch 'fc/remote-hg'

* fc/remote-hg:
  remote-hg: strip extra newline
  remote-hg: use marks instead of inlined files
  remote-hg: small performance improvement
  remote-hg: allow refs with spaces
  remote-hg: don't update bookmarks unnecessarily
  remote-hg: add support for schemes extension
  remote-hg: improve email sanitation
  remote-hg: add custom local tag write code
  remote-hg: write tags in the appropriate branch
  remote-hg: custom method to write tags
  remote-hg: add support for tag objects
  remote-hg: add branch_tip() helper
  remote-hg: properly mark branches up-to-date
  remote-hg: use python urlparse
  remote-hg: safer bookmark pushing
  remote-helpers: avoid has_key

12 years agoMerge branch 'fc/remote-bzr'
Junio C Hamano [Fri, 26 Apr 2013 22:18:26 +0000 (15:18 -0700)]
Merge branch 'fc/remote-bzr'

* fc/remote-bzr:
  remote-bzr: use proper push method

12 years agoMerge branch 'jc/warn-pathless-add-finishing-touches'
Junio C Hamano [Fri, 26 Apr 2013 22:17:48 +0000 (15:17 -0700)]
Merge branch 'jc/warn-pathless-add-finishing-touches'

* jc/warn-pathless-add-finishing-touches:
  git add: avoid "-u/-A without pathspec" warning on stat-dirty paths

12 years agogit add: avoid "-u/-A without pathspec" warning on stat-dirty paths
Junio C Hamano [Fri, 26 Apr 2013 20:44:35 +0000 (13:44 -0700)]
git add: avoid "-u/-A without pathspec" warning on stat-dirty paths

In preparation for Git 2.0, "git add -u/-A" without pathspec checks
all the working tree (not limited to the current directory) and
issues a warning when it finds any path that we might add in Git
2.0, because that would mean the users' fingers need to be trained
to explicitly say "." if they want to keep the current behaviour.

However, the check was incomplete, because "git add" usually does
not refresh the index, considers a path that is stat-dirty but has
contents that is otherwise up-to-date in the index as "we might
add", and relies on that it is a no-op to add the same thing again
via the add_file_to_index() API (which also knows not to say "added"
in verbose mode when this happens).  We do not want to trigger the
warning for a path that is outside the current directory is merely
stat-dirty, as it won't be added in Git 2.0, either.

Signed-off-by: Junio C Hamano <redacted>
Acked-by: Jonathan Nieder <redacted>
12 years agoSync with 1.8.2.2
Junio C Hamano [Fri, 26 Apr 2013 20:00:42 +0000 (13:00 -0700)]
Sync with 1.8.2.2

12 years agoGit 1.8.2.2
Junio C Hamano [Fri, 26 Apr 2013 18:30:08 +0000 (11:30 -0700)]
Git 1.8.2.2

Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'jk/a-thread-only-dies-once' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:25:59 +0000 (11:25 -0700)]
Merge branch 'jk/a-thread-only-dies-once' into maint

* jk/a-thread-only-dies-once:
  run-command: use thread-aware die_is_recursing routine
  usage: allow pluggable die-recursion checks

12 years agoMerge branch 'jn/gitweb-install-doc' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:12:48 +0000 (11:12 -0700)]
Merge branch 'jn/gitweb-install-doc' into maint

* jn/gitweb-install-doc:
  gitweb/INSTALL: GITWEB_CONFIG_SYSTEM is for backward compatibility
  gitweb/INSTALL: Simplify description of GITWEB_CONFIG_SYSTEM

12 years agoMerge branch 'fc/untracked-zsh-prompt' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:12:30 +0000 (11:12 -0700)]
Merge branch 'fc/untracked-zsh-prompt' into maint

* fc/untracked-zsh-prompt:
  prompt: fix untracked files for zsh

12 years agoMerge branch 'jk/receive-pack-deadlocks-with-early-failure' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:12:17 +0000 (11:12 -0700)]
Merge branch 'jk/receive-pack-deadlocks-with-early-failure' into maint

* jk/receive-pack-deadlocks-with-early-failure:
  receive-pack: close sideband fd on early pack errors

12 years agoMerge branch 'jk/chopped-ident' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:11:51 +0000 (11:11 -0700)]
Merge branch 'jk/chopped-ident' into maint

* jk/chopped-ident:
  blame: handle broken commit headers gracefully
  pretty: handle broken commit headers gracefully
  cat-file: print tags raw for "cat-file -p"

12 years agoMerge branch 'rt/commentchar-fmt-merge-msg' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:10:47 +0000 (11:10 -0700)]
Merge branch 'rt/commentchar-fmt-merge-msg' into maint

* rt/commentchar-fmt-merge-msg:
  t6200: avoid path mangling issue on Windows
  fmt-merge-msg: use core.commentchar in tag signatures completely
  fmt-merge-msg: respect core.commentchar in people credits

12 years agoMerge branch 'rs/empty-archive' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:03:31 +0000 (11:03 -0700)]
Merge branch 'rs/empty-archive' into maint

* rs/empty-archive:
  t5004: fix issue with empty archive test and bsdtar

12 years agoMerge branch 'pe/pull-rebase-v-q' into maint
Junio C Hamano [Fri, 26 Apr 2013 18:00:14 +0000 (11:00 -0700)]
Merge branch 'pe/pull-rebase-v-q' into maint

* pe/pull-rebase-v-q:
  pull: Apply -q and -v options to rebase mode as well

12 years agot7409: do not use export X=Y
Torsten Bögershausen [Fri, 26 Apr 2013 09:18:28 +0000 (11:18 +0200)]
t7409: do not use export X=Y

The shell syntax "export X=Y A=B" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agotest-hg-hg-git.sh: do not use export X=Y
Torsten Bögershausen [Fri, 26 Apr 2013 09:17:43 +0000 (11:17 +0200)]
test-hg-hg-git.sh: do not use export X=Y

The shell syntax "export X=Y" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agotest-hg-bidi.sh: do not use export X=Y
Torsten Bögershausen [Fri, 26 Apr 2013 09:17:56 +0000 (11:17 +0200)]
test-hg-bidi.sh: do not use export X=Y

The shell syntax "export X=Y A=B" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agot9501: do not use export X=Y
Torsten Bögershausen [Fri, 26 Apr 2013 09:18:07 +0000 (11:18 +0200)]
t9501: do not use export X=Y

The shell syntax "export X=Y" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agot9020: do not use export X=Y
Torsten Bögershausen [Fri, 26 Apr 2013 09:18:16 +0000 (11:18 +0200)]
t9020: do not use export X=Y

The shell syntax "export X=Y" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoremote-bzr: use proper push method
Felipe Contreras [Thu, 25 Apr 2013 11:25:37 +0000 (06:25 -0500)]
remote-bzr: use proper push method

Do not just randomly synchronize the revisions with no checks at
all.

I don't have any evidence that there's anything wrong with the
current code, which Bazaar seems to use, but for different purposes.
Let's use the logic Bazaar UI uses to avoid surprises.

Also, add a non-ff check.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agopretty: remove intermediate strbufs from pp_user_info()
René Scharfe [Thu, 25 Apr 2013 19:43:56 +0000 (21:43 +0200)]
pretty: remove intermediate strbufs from pp_user_info()

Use namebuf/namelen and mailbuf/maillen directly instead of copying
their contents into strbufs first.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agopretty: simplify output line length calculation in pp_user_info()
René Scharfe [Thu, 25 Apr 2013 19:41:57 +0000 (21:41 +0200)]
pretty: simplify output line length calculation in pp_user_info()

Keep namelen unchanged and don't use it to hold a value that we're not
interested in anyway -- we can use maillen and the constant part
directly instead.  This simplifies the code slightly and prepares for
the next patch that makes use of the original value of namelen.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agopretty: simplify input line length calculation in pp_user_info()
René Scharfe [Thu, 25 Apr 2013 19:40:25 +0000 (21:40 +0200)]
pretty: simplify input line length calculation in pp_user_info()

Instead of searching for LF and NUL with two strchr() calls use a single
strchrnul() call.  We don't need to check if the returned pointer is NULL
because either we'll find the NUL at the end of line, or the caller
forgot to NUL-terminate the string and we'll overrun the buffer in any
case.  Also we don't need to pass LF or NUL to split_ident_line() as it
ignores it anyway.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoprune: introduce OPT_EXPIRY_DATE() and use it
Junio C Hamano [Thu, 25 Apr 2013 18:13:49 +0000 (11:13 -0700)]
prune: introduce OPT_EXPIRY_DATE() and use it

Earlier we added support for --expire=all (or --expire=now) that
considers all crufts, regardless of their age, as eligible for
garbage collection by turning command argument parsers that use
approxidate() to use parse_expiry_date(), but "git prune" used a
built-in parse-options facility OPT_DATE() and did not benefit from
the new function.

Signed-off-by: Junio C Hamano <redacted>
12 years agot5801: "VAR=VAL shell_func args" is forbidden
Junio C Hamano [Thu, 25 Apr 2013 17:18:37 +0000 (10:18 -0700)]
t5801: "VAR=VAL shell_func args" is forbidden

It is not a portable expectation that a single-shot environment
variable assignment works when calling a shell function, not a
command.

Set and export the variable before calling "test_must_fail git push"
instead.  This change would not hurt because this is the last
command in the subprocess and the environment will not seep through
to later tests without using a single-shot assignment.

Signed-off-by: Junio C Hamano <redacted>
12 years agobash-prompt.sh: show where rebase is at when stopped
Zoltan Klinger [Thu, 25 Apr 2013 09:28:54 +0000 (19:28 +1000)]
bash-prompt.sh: show where rebase is at when stopped

When a rebase stops (e.g. interrupted by a merge conflict), it could
be useful to know how far a rebase has progressed and how many
commits in total this rebase will apply. Teach the __git_ps1()
command to display the number of commits so far applied and the
total number of commits to be applied, like this:

  ((3ec0a6a...)|REBASE 2/5)

In the example above the rebase has stopped at the second commit due to
a merge conflict and there are a total number of five commits to be
applied by this rebase.

This information can be already obtained from the following files which are
being generated during the rebase:

    GIT_DIR/.git/rebase-merge/msgnum (git-rebase--merge.sh)
    GIT_DIR/.git/rebase-merge/end    (git-rebase--merge.sh)
    GIT_DIR/.git/rebase-apply/next   (git-am.sh)
    GIT_DIR/.git/rebase-apply/last   (git-am.sh)

but "rebase -i" does not leave necessary clues.

Implement this feature by doing these three things:

  1) Modify git-rebase--interactive.sh to also create

GIT_DIR/.git/rebase-merge/msgnum
GIT_DIR/.git/rebase-merge/end

     files for the number of commits so far applied and the total
     number of commits to be applied.

  2) Modify git-prompt.sh to read and display info from the above
     files.

  3) Update test t9903-bash-prompt.sh to reflect changes introduced
     by this patch.

Signed-off-by: Zoltan Klinger <redacted>
Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'jk/remote-helper-with-signed-tags'
Junio C Hamano [Wed, 24 Apr 2013 23:30:50 +0000 (16:30 -0700)]
Merge branch 'jk/remote-helper-with-signed-tags'

Allows remote-helpers to declare they can handle signed tags, and
issue a warning when using those that don't.

* jk/remote-helper-with-signed-tags:
  transport-helper: add 'signed-tags' capability
  transport-helper: pass --signed-tags=warn-strip to fast-export
  fast-export: add --signed-tags=warn-strip mode

12 years agoSync with maint
Junio C Hamano [Wed, 24 Apr 2013 23:30:04 +0000 (16:30 -0700)]
Sync with maint

* maint:
  Update draft release notes to 1.8.2.2
  completion: remove duplicate block for "git commit -c"
  cherry-pick/revert: make usage say '<commit-ish>...'

12 years agoUpdate draft release notes to 1.8.2.2
Junio C Hamano [Wed, 24 Apr 2013 23:22:07 +0000 (16:22 -0700)]
Update draft release notes to 1.8.2.2

Signed-off-by: Junio C Hamano <redacted>
12 years agoMerge branch 'jk/diff-algo-finishing-touches' into maint
Junio C Hamano [Wed, 24 Apr 2013 23:17:13 +0000 (16:17 -0700)]
Merge branch 'jk/diff-algo-finishing-touches' into maint

"git diff --diff-algorithm=algo" was understood by the command line
parser, but "git diff --diff-algorithm algo" was not.

* jk/diff-algo-finishing-touches:
  diff: allow unstuck arguments with --diff-algorithm
  git-merge(1): document diff-algorithm option to merge-recursive

12 years agoMerge branch 'sr/log-SG-no-textconv' into maint
Junio C Hamano [Wed, 24 Apr 2013 23:15:44 +0000 (16:15 -0700)]
Merge branch 'sr/log-SG-no-textconv' into maint

"git log -S/-G" started paying attention to textconv filter, but
there was no way to disable this.  Make it honor --no-textconv
option.

* sr/log-SG-no-textconv:
  diffcore-pickaxe: unify code for log -S/-G
  diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>"
  diffcore-pickaxe: port optimization from has_changes() to diff_grep()
  diffcore-pickaxe: respect --no-textconv
  diffcore-pickaxe: remove fill_one()
  diffcore-pickaxe: remove unnecessary call to get_textconv()

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