]> asedeno.scripts.mit.edu Git - git.git/log
git.git
15 years agoMerge branch 'as/autocorrect-alias'
Junio C Hamano [Sun, 18 Jan 2009 07:05:34 +0000 (23:05 -0800)]
Merge branch 'as/autocorrect-alias'

* as/autocorrect-alias:
  git.c: make autocorrected aliases work

15 years agoMerge branch 'rs/fgrep'
Junio C Hamano [Sun, 18 Jan 2009 07:05:28 +0000 (23:05 -0800)]
Merge branch 'rs/fgrep'

* rs/fgrep:
  grep: don't call regexec() for fixed strings
  grep -w: forward to next possible position after rejected match

15 years agoMerge branch 'rs/maint-shortlog-foldline'
Junio C Hamano [Sun, 18 Jan 2009 07:05:23 +0000 (23:05 -0800)]
Merge branch 'rs/maint-shortlog-foldline'

* rs/maint-shortlog-foldline:
  shortlog: handle multi-line subjects like log --pretty=oneline et. al. do

15 years agoMerge branch 'mh/maint-commit-color-status'
Junio C Hamano [Sun, 18 Jan 2009 07:05:19 +0000 (23:05 -0800)]
Merge branch 'mh/maint-commit-color-status'

* mh/maint-commit-color-status:
  git-status -v: color diff output when color.ui is set
  git-commit: color status output when color.ui is set

15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 18 Jan 2009 07:04:40 +0000 (23:04 -0800)]
Merge branch 'maint'

* maint:
  Update draft release notes for 1.6.1.1
  builtin-fsck: fix off by one head count
  t5540: clarify that http-push does not handle packed-refs on the remote
  http-push: when making directories, have a trailing slash in the path name
  http-push: fix off-by-path_len
  Documentation: let asciidoc align related options
  githooks.txt: add missing word
  builtin-commit.c: do not remove COMMIT_EDITMSG

15 years agoUpdate draft release notes for 1.6.1.1
Junio C Hamano [Sun, 18 Jan 2009 07:04:35 +0000 (23:04 -0800)]
Update draft release notes for 1.6.1.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobundle: allow the same ref to be given more than once
Junio C Hamano [Sun, 18 Jan 2009 06:27:08 +0000 (22:27 -0800)]
bundle: allow the same ref to be given more than once

"git bundle create x master master" used to create a bundle that lists
the same branch (master) twice.  Cloning from such a bundle resulted in
a needless warning "warning: Duplicated ref: refs/remotes/origin/master".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Sun, 18 Jan 2009 06:39:49 +0000 (22:39 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  builtin-fsck: fix off by one head count
  Documentation: let asciidoc align related options
  githooks.txt: add missing word
  builtin-commit.c: do not remove COMMIT_EDITMSG

15 years agobuiltin-fsck: fix off by one head count
Christian Couder [Sun, 18 Jan 2009 03:46:09 +0000 (04:46 +0100)]
builtin-fsck: fix off by one head count

According to the man page, if "git fsck" is passed one or more heads, it
should verify connectivity and validity of only objects reachable from the
heads it is passed.

However, since 5ac0a20 (Make builtin-fsck.c use parse_options.,
2007-10-15) the command behaved as if no heads were passed, when given
only one argument.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorevision walker: include a detached HEAD in --all
Johannes Schindelin [Fri, 16 Jan 2009 12:52:53 +0000 (13:52 +0100)]
revision walker: include a detached HEAD in --all

When HEAD is detached, --all should list it, too, logically, as a
detached HEAD is by definition a temporary, unnamed branch.

It is especially necessary to list it when garbage collecting, as
the detached HEAD would be trashed.

Noticed by Thomas Rast.

Note that this affects creating bundles with --all; I contend that it
is a good change to add the HEAD, so that cloning from such a bundle
will give you a current branch.  However, I had to fix t5701 as it
assumed that --all does not imply HEAD.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix gitdir detection when in subdir of gitdir
SZEDER Gábor [Fri, 16 Jan 2009 15:37:33 +0000 (16:37 +0100)]
Fix gitdir detection when in subdir of gitdir

If the current working directory is a subdirectory of the gitdir (e.g.
<repo>/.git/refs/), then setup_git_directory_gently() will climb its
parent directories until it finds itself in a gitdir.  However, no
matter how many parent directories it climbs, it sets
'GIT_DIR_ENVIRONMENT' to ".", which is obviously wrong.

This behaviour affected at least 'git rev-parse --git-dir' and hence
caused some errors in bash completion (e.g. customized command prompt
when on a detached head and completion of refs).

To fix this, we set the absolute path of the found gitdir instead.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-am: Make it easier to see which patch failed
Jonas Flodén [Fri, 16 Jan 2009 14:34:47 +0000 (15:34 +0100)]
git-am: Make it easier to see which patch failed

When git-am fails it's not always easy to see which patch failed,
since it's often hidden by a lot of error messages.
Add an extra line which prints the name of the failed patch just
before the resolve message to make it easier to find.

Signed-off-by: Jonas Flodén <jonas@floden.nu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocontrib: add 'git difftool' for launching common merge tools
David Aguilar [Fri, 16 Jan 2009 08:00:02 +0000 (00:00 -0800)]
contrib: add 'git difftool' for launching common merge tools

'git difftool' is a git command that allows you to compare and edit files
between revisions using common merge tools.  'git difftool' does what
'git mergetool' does but its use is for non-merge situations such as
when preparing commits or comparing changes against the index.
It uses the same configuration variables as 'git mergetool' and
provides the same command-line interface as 'git diff'.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd is_regex_special()
René Scharfe [Sat, 17 Jan 2009 15:50:37 +0000 (16:50 +0100)]
Add is_regex_special()

Add is_regex_special(), a character class macro for chars that have a
special meaning in regular expressions.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoChange NUL char handling of isspecial()
René Scharfe [Sat, 17 Jan 2009 15:50:34 +0000 (16:50 +0100)]
Change NUL char handling of isspecial()

Replace isspecial() by the new macro is_glob_special(), which is more,
well, specialized.  The former included the NUL char in its character
class, while the letter only included characters that are special to
file name globbing.

The new name contains underscores because they enhance readability
considerably now that it's made up of three words.  Renaming the
function is necessary to document its changed scope.

The call sites of isspecial() are updated to check explicitly for NUL.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoReformat ctype.c
René Scharfe [Sat, 17 Jan 2009 15:50:29 +0000 (16:50 +0100)]
Reformat ctype.c

Enhance the readability of ctype.c by using an enum instead of macros
to initialize the character class table.  This allows the use of a single
letter to mark a char, making the table fit within 80 columns.

Also list the index of the last entry in each row in the following comment.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd ctype test
René Scharfe [Sat, 17 Jan 2009 15:50:13 +0000 (16:50 +0100)]
Add ctype test

Manipulating the character class table in ctype.c by hand is error prone.
To ensure that typos are found quickly, add a test program and script.

test-ctype checks the output of the character class macros isspace() et.
al. by applying them on all possible char values and consulting a list of
all characters in the particular class.  It doesn't check tolower() and
toupper(); this could be added later.

The test script t0070-fundamental.sh is created because there is no good
place for the ctype test, yet -- except for t0000-basic.sh perhaps, but
it doesn't run well on Windows, yet.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: refactor 'git log --pretty=<format>' options
SZEDER Gábor [Fri, 16 Jan 2009 16:02:15 +0000 (17:02 +0100)]
bash: refactor 'git log --pretty=<format>' options

Both 'git log' and 'show' have the same '--pretty=<format>' option
with the same formats.  So refactor these formats into a common
variable.

While at it, also add 'format:' to the list.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: add missing format-patch command line options
SZEDER Gábor [Fri, 16 Jan 2009 16:02:04 +0000 (17:02 +0100)]
bash: add missing format-patch command line options

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: remove unnecessary checks for long options with argument
SZEDER Gábor [Fri, 16 Jan 2009 16:01:57 +0000 (17:01 +0100)]
bash: remove unnecessary checks for long options with argument

__gitcomp takes care of it since 5447aac7 (bash: fix long option with
argument double completion, 2008-03-05)

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot5540: clarify that http-push does not handle packed-refs on the remote
Johannes Schindelin [Sat, 17 Jan 2009 15:41:41 +0000 (16:41 +0100)]
t5540: clarify that http-push does not handle packed-refs on the remote

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohttp-push: when making directories, have a trailing slash in the path name
Johannes Schindelin [Sat, 17 Jan 2009 15:11:51 +0000 (16:11 +0100)]
http-push: when making directories, have a trailing slash in the path name

The function lock_remote() sends MKCOL requests to make leading
directories; However, if it does not put a forward slash '/' at the end of
the path, the server sends a 301 redirect.

By leaving the '/' in place, we can avoid this additional step.

Incidentally, at least one version of Curl (7.16.3) does not resend
credentials when it follows a 301 redirect, so this commit also fixes
a bug.

Original patch by Tay Ray Chuan <rctay89@gmail.com>.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohttp-push: fix off-by-path_len
Johannes Schindelin [Sat, 17 Jan 2009 15:36:26 +0000 (16:36 +0100)]
http-push: fix off-by-path_len

When getting the result of remote_ls(), we were advancing the variable
"path" to the relative path inside the repository.

However, then we went on to malloc a bogus amount of memory: we were
subtracting the prefix length _again_, quite possibly getting something
negative, which xmalloc() interprets as really, really much.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: let asciidoc align related options
Markus Heidelberg [Fri, 16 Jan 2009 21:42:33 +0000 (22:42 +0100)]
Documentation: let asciidoc align related options

Fixes the description of the -t option in git-mergetool, which
failed to hint that it takes an argument.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoexpand --pretty=format color options
Jeff King [Sat, 17 Jan 2009 15:38:46 +0000 (10:38 -0500)]
expand --pretty=format color options

Currently, the only colors available to --pretty=format
users are red, green, and blue. Rather than expand it with a
few new colors, this patch makes the usual config color
syntax available, including more colors, backgrounds, and
attributes.

Because colors are no longer bounded to a single word (e.g.,
%Cred), this uses a more advanced syntax that features a
beginning and end delimiter (but the old syntax still
works). So you can now do:

  git log --pretty=tformat:'%C(yellow)%h%C(reset) %s'

to emulate --pretty=oneline, or even

  git log --pretty=tformat:'%C(cyan magenta bold)%s%C(reset)'

if you want to relive the awesomeness of 4-color CGA.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocolor: make it easier for non-config to parse color specs
Jeff King [Sat, 17 Jan 2009 15:32:30 +0000 (10:32 -0500)]
color: make it easier for non-config to parse color specs

We have very featureful color-parsing routines which are
used for color.diff.* and other options. Let's make it
easier to use those routines from other parts of the code.

This patch adds a color_parse_mem() helper function which
takes a length-bounded string instead of a NUL-terminated
one. While the helper is only a few lines long, it is nice
to abstract this out so that:

 - callers don't forget to free() the temporary buffer

 - right now, it is implemented in terms of color_parse().
   But it would be more efficient to reverse this and
   implement color_parse in terms of color_parse_mem.

This also changes the error string for an invalid color not
to mention the word "config", since it is not always
appropriate (and when it is, the context is obvious since
the offending config variable is given).

Finally, while we are in the area, we clean up the parameter
names in the declaration of color_parse; the var and value
parameters were reversed from the actual implementation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: let asciidoc align related options
Markus Heidelberg [Fri, 16 Jan 2009 21:42:33 +0000 (22:42 +0100)]
Documentation: let asciidoc align related options

Command line options can share the same paragraph of description, if
they are related or synonymous. In these cases they should be written
among each other, so that asciidoc can format them itself.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogithooks.txt: add missing word
Stephan Beyer [Fri, 16 Jan 2009 20:36:06 +0000 (21:36 +0100)]
githooks.txt: add missing word

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-commit.c: do not remove COMMIT_EDITMSG
Stephan Beyer [Fri, 16 Jan 2009 19:40:05 +0000 (20:40 +0100)]
builtin-commit.c: do not remove COMMIT_EDITMSG

git-commit tries to remove the file ./COMMIT_EDITMSG instead of
$GIT_DIR/COMMIT_EDITMSG after commit preparation (e.g. running
hooks, launching editor).
This behavior exists since f5bbc3225c4b07 "Port git commit to C".

Some test cases (e.g. t/t7502-commit.sh) rely on the existence of
$GIT_DIR/COMMIT_EDITMSG after committing and, I guess, many people
are used to it.  So it is best not to remove it.

This patch just removes the removal of COMMIT_EDITMSG.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorun_hook(): allow more than 9 hook arguments
Stephan Beyer [Sat, 17 Jan 2009 03:02:55 +0000 (04:02 +0100)]
run_hook(): allow more than 9 hook arguments

This is done using the ALLOC_GROW macro.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorun_hook(): check the executability of the hook before filling argv
Stephan Beyer [Fri, 16 Jan 2009 19:10:01 +0000 (20:10 +0100)]
run_hook(): check the executability of the hook before filling argv

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapi-run-command.txt: talk about run_hook()
Stephan Beyer [Fri, 16 Jan 2009 19:10:00 +0000 (20:10 +0100)]
api-run-command.txt: talk about run_hook()

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMove run_hook() from builtin-commit.c into run-command.c (libgit)
Stephan Beyer [Fri, 16 Jan 2009 19:09:59 +0000 (20:09 +0100)]
Move run_hook() from builtin-commit.c into run-command.c (libgit)

A function that runs a hook is used in several Git commands.
builtin-commit.c has the one that is most general for cases without
piping. The one in builtin-gc.c prints some useful warnings.
This patch moves a merged version of these variants into libgit and
lets the other builtins use this libified run_hook().

The run_hook() function used in receive-pack.c feeds the standard
input of the pre-receive or post-receive hooks. This function is
renamed to run_receive_hook() because the libified run_hook() cannot
handle this.

Mentored-by: Daniel Barkalow <barkalow@iabervon.org>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheckout: don't crash on file checkout before running post-checkout hook
Stephan Beyer [Fri, 16 Jan 2009 19:09:58 +0000 (20:09 +0100)]
checkout: don't crash on file checkout before running post-checkout hook

In the case of

git init
echo exit >.git/hooks/post-checkout
chmod +x .git/hooks/post-checkout
touch foo
git add foo
rm foo
git checkout -- foo

git-checkout resulted in a Segmentation fault, because there is no new
branch set for the post-checkout hook.

This patch makes use of the null SHA as it is set for the old branch.

While at it, I removed the xstrdup() around the sha1_to_hex(...) calls
in builtin-checkout.c/post_checkout_hook() because sha1_to_hex()
uses four buffers for the hex-dumped SHA and we only need two.
(Duplicating one buffer is only needed if we need more than four.)

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocolor-words: make regex configurable via attributes
Thomas Rast [Sat, 17 Jan 2009 16:29:48 +0000 (17:29 +0100)]
color-words: make regex configurable via attributes

Make the --color-words splitting regular expression configurable via
the diff driver's 'wordregex' attribute.  The user can then set the
driver on a file in .gitattributes.  If a regex is given on the
command line, it overrides the driver's setting.

We also provide built-in regexes for the languages that already had
funcname patterns, and add an appropriate diff driver entry for C/++.
(The patterns are designed to run UTF-8 sequences into a single chunk
to make sure they remain readable.)

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocolor-words: expand docs with precise semantics
Thomas Rast [Sat, 17 Jan 2009 16:29:47 +0000 (17:29 +0100)]
color-words: expand docs with precise semantics

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocolor-words: enable REG_NEWLINE to help user
Thomas Rast [Sat, 17 Jan 2009 16:29:46 +0000 (17:29 +0100)]
color-words: enable REG_NEWLINE to help user

We silently truncate a match at the newline, which may lead to
unexpected behaviour, e.g., when matching "<[^>]*>" against

  <foo
  bar>

since then "<foo" becomes a word (and "bar>" doesn't!) even though the
regex said only angle-bracket-delimited things can be words.

To alleviate the problem slightly, use REG_NEWLINE so that negated
classes can't match a newline.  Of course newlines can still be
matched explicitly.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocolor-words: take an optional regular expression describing words
Johannes Schindelin [Sat, 17 Jan 2009 16:29:45 +0000 (17:29 +0100)]
color-words: take an optional regular expression describing words

In some applications, words are not delimited by white space.  To
allow for that, you can specify a regular expression describing
what makes a word with

git diff --color-words='[A-Za-z0-9]+'

Note that words cannot contain newline characters.

As suggested by Thomas Rast, the words are the exact matches of the
regular expression.

Note that a regular expression beginning with a '^' will match only
a word at the beginning of the hunk, not a word at the beginning of
a line, and is probably not what you want.

This commit contains a quoting fix by Thomas Rast.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocolor-words: change algorithm to allow for 0-character word boundaries
Johannes Schindelin [Sat, 17 Jan 2009 16:29:44 +0000 (17:29 +0100)]
color-words: change algorithm to allow for 0-character word boundaries

Up until now, the color-words code assumed that word boundaries are
identical to white space characters.

Therefore, it could get away with a very simple scheme: it copied the
hunks, substituted newlines for each white space character, called
libxdiff with the processed text, and then identified the text to
output by the offsets (which agreed since the original text had the
same length).

This code was ugly, for a number of reasons:

- it was impossible to introduce 0-character word boundaries,

- we had to print everything word by word, and

- the code needed extra special handling of newlines in the removed part.

Fix all of these issues by processing the text such that

- we build word lists, separated by newlines,

- we remember the original offsets for every word, and

- after calling libxdiff on the wordlists, we parse the hunk headers, and
  find the corresponding offsets, and then

- we print the removed/added parts in one go.

The pre and post samples in the test were provided by Santi Béjar.

Note that there is some strange special handling of hunk headers where
one line range is 0 due to POSIX: in this case, the start is one too
low.  In other words a hunk header '@@ -1,0 +2 @@' actually means that
the line must be added after the _second_ line of the pre text, _not_
the first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocolor-words: refactor word splitting and use ALLOC_GROW()
Johannes Schindelin [Sat, 17 Jan 2009 16:29:43 +0000 (17:29 +0100)]
color-words: refactor word splitting and use ALLOC_GROW()

Word splitting is now performed by the function diff_words_fill(),
avoiding having the same code twice.

In the same spirit, avoid duplicating the code of ALLOC_GROW().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd color_fwrite_lines(), a function coloring each line individually
Johannes Schindelin [Sat, 17 Jan 2009 16:29:42 +0000 (17:29 +0100)]
Add color_fwrite_lines(), a function coloring each line individually

We have to set the color before every line and reset it before every
newline.  Add a function color_fwrite_lines() which does that for us.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Fri, 16 Jan 2009 02:52:35 +0000 (18:52 -0800)]
Merge branch 'maint'

* maint:
  t3404: Add test case for auto-amending only edited commits after "edit"
  t3404: Add test case for aborted --continue after "edit"
  t3501: check that commits are actually done

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Thu, 15 Jan 2009 22:33:54 +0000 (14:33 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  t3404: Add test case for auto-amending only edited commits after "edit"
  t3404: Add test case for aborted --continue after "edit"
  t3501: check that commits are actually done

15 years agot3404: Add test case for auto-amending only edited commits after "edit"
Stephan Beyer [Thu, 15 Jan 2009 12:56:16 +0000 (13:56 +0100)]
t3404: Add test case for auto-amending only edited commits after "edit"

Add a test case for the bugfix introduced by commit c14c3c82d
"git-rebase--interactive: auto amend only edited commit".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3404: Add test case for aborted --continue after "edit"
Stephan Beyer [Thu, 15 Jan 2009 12:56:15 +0000 (13:56 +0100)]
t3404: Add test case for aborted --continue after "edit"

Add a test case for the bugfix introduced by commit 8beb1f33d
"git-rebase-interactive: do not squash commits on abort".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3501: check that commits are actually done
Stephan Beyer [Thu, 15 Jan 2009 13:03:17 +0000 (14:03 +0100)]
t3501: check that commits are actually done

The basic idea of t3501 is to check whether revert
and cherry-pick works on renamed files.
But as there is no pure cherry-pick/revert test, it is
good to also check if commits are actually done in that
scenario.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash-completion: Add comments to remind about required arguments
Ted Pavlic [Thu, 15 Jan 2009 16:02:23 +0000 (11:02 -0500)]
bash-completion: Add comments to remind about required arguments

Add a few simple comments above commands that take arguments. These
comments are meant to remind developers of potential problems that
can occur when the script is sourced on systems with "set -u." Any
function which requires arguments really ought to be called with
explicit arguments given.

Also adds a #!bash to the top of bash completions so that editing
software can always identify that the file is of sh type.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash-completion: Try bash completions before simple filetype
Ted Pavlic [Thu, 15 Jan 2009 16:02:22 +0000 (11:02 -0500)]
bash-completion: Try bash completions before simple filetype

When a git completion is not found, a bash shell should try bash-type
completions first before going to standard filetype completions. This
patch adds "-o bashdefault" to the completion line. If that option is
not available, it uses the old method.

This behavior was inspired by Mercurial's bash completion script.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash-completion: Support running when set -u is enabled
Ted Pavlic [Thu, 15 Jan 2009 16:02:21 +0000 (11:02 -0500)]
bash-completion: Support running when set -u is enabled

Under "set -u" semantics, it is an error to access undefined variables.
Some user environments may enable this setting in the interactive shell.

In any context where the completion functions access an undefined
variable, accessing a default empty string (aka "${1-}" instead of "$1")
is a reasonable way to code the function, as it silences the undefined
variable error while still supplying an empty string.

In this patch, functions that should always take an argument still use
$1. Functions that have optional arguments use ${1-}.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 15 Jan 2009 06:58:46 +0000 (22:58 -0800)]
Merge branch 'maint'

* maint:
  Update draft release notes to 1.6.1.1
  Make t3411 executable
  fix handling of multiple untracked files for git mv -k
  add test cases for "git mv -k"

15 years agoUpdate draft release notes to 1.6.1.1
Junio C Hamano [Thu, 15 Jan 2009 06:43:04 +0000 (22:43 -0800)]
Update draft release notes to 1.6.1.1

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Thu, 15 Jan 2009 06:34:05 +0000 (22:34 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  fix handling of multiple untracked files for git mv -k
  add test cases for "git mv -k"

15 years agoremove pathspec_match, use match_pathspec instead
Clemens Buchacher [Wed, 14 Jan 2009 14:54:35 +0000 (15:54 +0100)]
remove pathspec_match, use match_pathspec instead

Both versions have the same functionality. This removes any
redundancy.

This also adds makes two extensions to match_pathspec:

- If pathspec is NULL, return 1. This reflects the behavior of git
  commands, for which no paths usually means "match all paths".

- If seen is NULL, do not use it.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoclean up pathspec matching
Clemens Buchacher [Wed, 14 Jan 2009 14:54:34 +0000 (15:54 +0100)]
clean up pathspec matching

If pathspec already matched exactly, it cannot match any more.
Originally, we had to continue anyways, because we did not
differentiate between exact, recursive and globbing matches.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake t3411 executable
Miklos Vajna [Thu, 15 Jan 2009 00:33:19 +0000 (01:33 +0100)]
Make t3411 executable

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-am: fix shell quoting
Junio C Hamano [Thu, 15 Jan 2009 00:29:59 +0000 (16:29 -0800)]
git-am: fix shell quoting

Noticed by Stephan Beyer; the new test is mine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix handling of multiple untracked files for git mv -k
Michael J Gruber [Wed, 14 Jan 2009 17:03:22 +0000 (18:03 +0100)]
fix handling of multiple untracked files for git mv -k

The "-k" option to "git mv" should allow specifying multiple untracked
files. Currently, multiple untracked files raise an assertion if they
appear consecutively as arguments. Fix this by decrementing the loop
index after removing one entry from the array of arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoadd test cases for "git mv -k"
Michael J Gruber [Wed, 14 Jan 2009 17:03:21 +0000 (18:03 +0100)]
add test cases for "git mv -k"

Add test cases for ignoring nonexisting and untracked files using the -k
option to "git mv". There is one known breakage related to multiple
untracked files specfied as consecutive arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate 1.6.2 draft release notes
Junio C Hamano [Wed, 14 Jan 2009 07:41:32 +0000 (23:41 -0800)]
Update 1.6.2 draft release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 14 Jan 2009 07:12:51 +0000 (23:12 -0800)]
Merge branch 'maint'

* maint:
  fast-import: Cleanup mode setting.
  Git.pm: call Error::Simple() properly

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Wed, 14 Jan 2009 07:10:50 +0000 (23:10 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  fast-import: Cleanup mode setting.
  Git.pm: call Error::Simple() properly

15 years agoMerge branch 'nd/grep-assume-unchanged'
Junio C Hamano [Wed, 14 Jan 2009 07:10:02 +0000 (23:10 -0800)]
Merge branch 'nd/grep-assume-unchanged'

* nd/grep-assume-unchanged:
  grep: grep cache entries if they are "assume unchanged"
  grep: support --no-ext-grep to test builtin grep

15 years agoMerge branch 'as/maint-shortlog-cleanup'
Junio C Hamano [Wed, 14 Jan 2009 07:10:00 +0000 (23:10 -0800)]
Merge branch 'as/maint-shortlog-cleanup'

* as/maint-shortlog-cleanup:
  builtin-shortlog.c: use string_list_append(), and don't strdup unnecessarily

15 years agoMerge branch 'jc/maint-ls-tree'
Junio C Hamano [Wed, 14 Jan 2009 07:09:57 +0000 (23:09 -0800)]
Merge branch 'jc/maint-ls-tree'

* jc/maint-ls-tree:
  Document git-ls-tree --full-tree
  ls-tree: add --full-tree option

15 years agoMerge branch 'js/bundle-tags'
Junio C Hamano [Wed, 14 Jan 2009 07:09:50 +0000 (23:09 -0800)]
Merge branch 'js/bundle-tags'

* js/bundle-tags:
  bundle: allow rev-list options to exclude annotated tags

15 years agoMerge branch 'js/add-not-submodule'
Junio C Hamano [Wed, 14 Jan 2009 07:09:47 +0000 (23:09 -0800)]
Merge branch 'js/add-not-submodule'

* js/add-not-submodule:
  git add: do not add files from a submodule

15 years agoMerge branch 'pb/maint-git-pm-false-dir'
Junio C Hamano [Wed, 14 Jan 2009 07:09:42 +0000 (23:09 -0800)]
Merge branch 'pb/maint-git-pm-false-dir'

* pb/maint-git-pm-false-dir:
  Git.pm: correctly handle directory name that evaluates to "false"

15 years agoMerge branch 'pj/maint-ldflags'
Junio C Hamano [Wed, 14 Jan 2009 07:09:38 +0000 (23:09 -0800)]
Merge branch 'pj/maint-ldflags'

* pj/maint-ldflags:
  configure clobbers LDFLAGS

15 years agoMerge branch 'fe/cvsserver'
Junio C Hamano [Wed, 14 Jan 2009 07:09:35 +0000 (23:09 -0800)]
Merge branch 'fe/cvsserver'

* fe/cvsserver:
  cvsserver: change generation of CVS author names
  cvsserver: add option to configure commit message

15 years agoMerge branch 'js/maint-bisect-gitk'
Junio C Hamano [Wed, 14 Jan 2009 07:09:29 +0000 (23:09 -0800)]
Merge branch 'js/maint-bisect-gitk'

* js/maint-bisect-gitk:
  bisect view: call gitk if Cygwin's SESSIONNAME variable is set

15 years agoMerge branch 'np/no-loosen-prune-expire-now'
Junio C Hamano [Wed, 14 Jan 2009 07:09:24 +0000 (23:09 -0800)]
Merge branch 'np/no-loosen-prune-expire-now'

* np/no-loosen-prune-expire-now:
  objects to be pruned immediately don't have to be loosened

15 years agoMerge branch 'cb/maint-unpack-trees-absense'
Junio C Hamano [Wed, 14 Jan 2009 07:09:20 +0000 (23:09 -0800)]
Merge branch 'cb/maint-unpack-trees-absense'

* cb/maint-unpack-trees-absense:
  unpack-trees: remove redundant path search in verify_absent
  unpack-trees: fix path search bug in verify_absent
  unpack-trees: handle failure in verify_absent

15 years agoMerge branch 'mc/cd-p-pwd'
Junio C Hamano [Wed, 14 Jan 2009 07:09:13 +0000 (23:09 -0800)]
Merge branch 'mc/cd-p-pwd'

* mc/cd-p-pwd:
  git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X

15 years agoMerge branch 'mh/cherry-default'
Junio C Hamano [Wed, 14 Jan 2009 07:09:09 +0000 (23:09 -0800)]
Merge branch 'mh/cherry-default'

* mh/cherry-default:
  Documentation: clarify which parameters are optional to git-cherry
  git-cherry: make <upstream> parameter optional

15 years agofast-import: Cleanup mode setting.
Felipe Contreras [Wed, 14 Jan 2009 01:37:07 +0000 (03:37 +0200)]
fast-import: Cleanup mode setting.

"S_IFREG | mode" makes only sense for 0644 and 0755.

Even though doing (S_IFREG | mode) may not hurt when mode is any other
supported value, that is only true because S_IFREG mode bit happens to
be already on for S_IFLNK or S_IFGITLINK.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGit.pm: call Error::Simple() properly
Jay Soffian [Tue, 13 Jan 2009 22:41:35 +0000 (17:41 -0500)]
Git.pm: call Error::Simple() properly

The error message to Error::Simple() must be passed as a single argument.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 13 Jan 2009 09:25:55 +0000 (01:25 -0800)]
Merge branch 'maint'

* maint:
  Avoid spurious error messages on error mistakes.
  contrib/examples/README: give an explanation of the status of these files

15 years agoMerge branch 'kk/maint-http-push' into maint
Junio C Hamano [Tue, 13 Jan 2009 09:15:49 +0000 (01:15 -0800)]
Merge branch 'kk/maint-http-push' into maint

* kk/maint-http-push:
  http-push: support full URI in handle_remote_ls_ctx()

15 years agoMerge branch 'js/maint-merge-recursive-r-d-conflict' into maint
Junio C Hamano [Tue, 13 Jan 2009 09:15:19 +0000 (01:15 -0800)]
Merge branch 'js/maint-merge-recursive-r-d-conflict' into maint

* js/maint-merge-recursive-r-d-conflict:
  merge-recursive: mark rename/delete conflict as unmerged

15 years agoMerge branch 'cb/maint-merge-recursive-fix' into maint
Junio C Hamano [Tue, 13 Jan 2009 09:13:56 +0000 (01:13 -0800)]
Merge branch 'cb/maint-merge-recursive-fix' into maint

* cb/maint-merge-recursive-fix:
  merge-recursive: do not clobber untracked working tree garbage
  modify/delete conflict resolution overwrites untracked file

Conflicts:
builtin-merge-recursive.c

15 years agoMerge branch 'ap/maint-apply-modefix' into maint
Junio C Hamano [Tue, 13 Jan 2009 08:56:40 +0000 (00:56 -0800)]
Merge branch 'ap/maint-apply-modefix' into maint

* ap/maint-apply-modefix:
  builtin-apply: prevent non-explicit permission changes

15 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Tue, 13 Jan 2009 08:40:19 +0000 (00:40 -0800)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  Avoid spurious error messages on error mistakes.
  contrib/examples/README: give an explanation of the status of these files

15 years agoAvoid spurious error messages on error mistakes.
Pierre Habouzit [Mon, 12 Jan 2009 23:09:36 +0000 (00:09 +0100)]
Avoid spurious error messages on error mistakes.

Prior to that, if the user chose "squash" as a first action, the stderr
looked like:

    grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory
    Cannot 'squash' without a previous commit

Now the first line is gone.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix Documentation typos surrounding the word 'handful'.
Jon Loeliger [Mon, 12 Jan 2009 20:02:07 +0000 (14:02 -0600)]
Fix Documentation typos surrounding the word 'handful'.

Some instances replaced by "handful of", others use
the word "few", a couple get a slight rewording.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosha1_file: make "read_object" static
Christian Couder [Mon, 12 Jan 2009 17:42:24 +0000 (18:42 +0100)]
sha1_file: make "read_object" static

This function is only used from "sha1_file.c".

And as we want to add a "replace_object" hook in "read_sha1_file",
we must not let people bypass the hook using something other than
"read_sha1_file".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocontrib/vim: change URL to point to the latest syntax files
Markus Heidelberg [Tue, 13 Jan 2009 02:10:26 +0000 (03:10 +0100)]
contrib/vim: change URL to point to the latest syntax files

Vim's SVN repository doesn't offer the latest runtime files, since
normally they are only updated there on a release. Though currently
there is no difference between the SVN and HTTP/FTP version of the git
syntax files.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocontrib/examples/README: give an explanation of the status of these files
jidanni@jidanni.org [Tue, 13 Jan 2009 01:19:42 +0000 (09:19 +0800)]
contrib/examples/README: give an explanation of the status of these files

We attempt to give an explanation of the status of the files in this
directory.

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTeach format-patch to handle output directory relative to cwd
Junio C Hamano [Mon, 12 Jan 2009 23:18:02 +0000 (15:18 -0800)]
Teach format-patch to handle output directory relative to cwd

Without any explicit -o parameter, we correctly avoided putting the
resulting patch output to the toplevel.  We should do the same when
the user gave a relative pathname to be consistent with this case.

Noticed by Cesar Eduardo Barros.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-am: add --directory=<dir> option
Junio C Hamano [Mon, 12 Jan 2009 06:21:48 +0000 (22:21 -0800)]
git-am: add --directory=<dir> option

Thanks to a200337 (git-am: propagate -C<n>, -p<n> options as well,
2008-12-04) and commits around it, "git am" is equipped to correctly
propagate the command line flags such as -C/-p/-whitespace across a patch
failure and restart.

It is trivial to support --directory option now, resurrecting previous
attempts by Kevin and Simon.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 12 Jan 2009 07:29:26 +0000 (23:29 -0800)]
Merge branch 'maint'

* maint:
  Documentation/git-push.txt: minor: compress one option

15 years agoMerge branch 'mh/maint-sendmail-cc-doc' into maint
Junio C Hamano [Mon, 12 Jan 2009 07:27:29 +0000 (23:27 -0800)]
Merge branch 'mh/maint-sendmail-cc-doc' into maint

* mh/maint-sendmail-cc-doc:
  doc/git-send-email: mention sendemail.cc config variable

15 years agoMerge branch 'jc/maint-do-not-switch-to-non-commit' into maint
Junio C Hamano [Mon, 12 Jan 2009 07:24:42 +0000 (23:24 -0800)]
Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint

* jc/maint-do-not-switch-to-non-commit:
  git checkout: do not allow switching to a tree-ish that is not a commit

15 years agorebase: update documentation for --root
Thomas Rast [Fri, 2 Jan 2009 22:28:29 +0000 (23:28 +0100)]
rebase: update documentation for --root

Since the new option depends on --onto and omission of <upstream>, use
a separate invocation style, and omit most options to save space.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorebase -i: learn to rebase root commit
Thomas Rast [Fri, 2 Jan 2009 22:28:28 +0000 (23:28 +0100)]
rebase -i: learn to rebase root commit

Teach git-rebase -i a new option --root, which instructs it to rebase
the entire history leading up to <branch>.  This is mainly for
symmetry with ordinary git-rebase; it cannot be used to edit the root
commit in-place (it requires --onto <newbase>).  Commits that already
exist in <newbase> are skipped.

In the normal mode of operation, this is fairly straightforward.  We
run cherry-pick in a loop, and cherry-pick has supported picking the
root commit since f95ebf7 (Allow cherry-picking root commits,
2008-07-04).

In --preserve-merges mode, we track the mapping from old to rewritten
commits and use it to update the parent list of each commit.  In this
case, we define 'rebase -i -p --root --onto $onto $branch' to rewrite
the parent list of all root commit(s) on $branch to contain $onto
instead.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorebase: learn to rebase root commit
Thomas Rast [Mon, 5 Jan 2009 17:35:16 +0000 (18:35 +0100)]
rebase: learn to rebase root commit

Teach git-rebase a new option --root, which instructs it to rebase the
entire history leading up to <branch>.  This option must be used with
--onto <newbase>, and causes commits that already exist in <newbase>
to be skipped.  (Normal operation skips commits that already exist in
<upstream> instead.)

One possible use-case is with git-svn: suppose you start hacking
(perhaps offline) on a new project, but later notice you want to
commit this work to SVN.  You will have to rebase the entire history,
including the root commit, on a (possibly empty) commit coming from
git-svn, to establish a history connection.  This previously had to
be done by cherry-picking the root commit manually.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation/git-push.txt: minor: compress one option
jidanni@jidanni.org [Mon, 12 Jan 2009 03:05:54 +0000 (11:05 +0800)]
Documentation/git-push.txt: minor: compress one option

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: add --authors-file test
Eric Wong [Sun, 11 Jan 2009 23:44:07 +0000 (15:44 -0800)]
git-svn: add --authors-file test

I'm not sure how often this functionality is used, but in case
it's not, having an extra test here will help catch breakage
sooner.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoCleanup of unused symcache variable inside diff-lib.c
Kjetil Barvik [Sun, 11 Jan 2009 18:36:42 +0000 (19:36 +0100)]
Cleanup of unused symcache variable inside diff-lib.c

Commit c40641b77b0274186fd1b327d5dc3246f814aaaf, 'Optimize
symlink/directory detection' by Linus Torvalds, removed the 'char
*symcache' parameter to the has_symlink_leading_path() function.  This
made all variables currently named 'symcache' inside diff-lib.c
unnecessary.

This also let us throw away the 'struct oneway_unpack_data', and
instead directly use the 'struct rev_info *revs' member, which
was the only member left after removal of the 'symcache[] array'
member.  The 'struct oneway_unpack_data' was introduced by the
following commit:

  948dd346  "diff-files: careful when inspecting work tree items"

Impact: cleanup
        PATH_MAX bytes less memory stack usage in some cases

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAllow cloning to an existing empty directory
Alexander Potashev [Sun, 11 Jan 2009 12:19:12 +0000 (15:19 +0300)]
Allow cloning to an existing empty directory

The die() message updated accordingly.

The previous behaviour was to only allow cloning when the destination
directory doesn't exist.

[jc: added trivial tests]

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoadd is_dot_or_dotdot inline function
Alexander Potashev [Sat, 10 Jan 2009 12:07:50 +0000 (15:07 +0300)]
add is_dot_or_dotdot inline function

A new inline function is_dot_or_dotdot is used to check if the
directory name is either "." or "..". It returns a non-zero value if
the given string is "." or "..". It's applicable to a lot of Git
source code.

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>