Commit graph

24513 commits

Author SHA1 Message Date
Nicolas Morey-Chaisemartin 9db31bdf5c submodule: Add --force option for git submodule update
By default git submodule update runs a simple checkout on submodules that
are not up-to-date. If the submodules contains modified or untracked
files, the command may exit sanely with an error:

  $ git submodule update
  error: Your local changes to the following files would be overwritten by
  checkout:
	  file
  Please, commit your changes or stash them before you can switch branches.
  Aborting
  Unable to checkout '1b69c6e55606b48d3284a3a9efe4b58bfb7e8c9e' in
  submodule path 'test1'

In order to reset a whole git submodule tree, a user has to run first 'git
submodule foreach --recursive git checkout -f' and then run 'git submodule
update'.

This patch adds a --force option for the update command (only used for
submodules without --rebase or --merge options). It passes the --force
option to git checkout which will throw away the local changes.

Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-04 10:50:50 -07:00
Junio C Hamano 8e848868ff Start preparing for 1.7.4.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-03 12:58:23 -07:00
Jeff King 8c8674fc95 pull: do not clobber untracked files on initial pull
For a pull into an unborn branch, we do not use "git merge"
at all. Instead, we call read-tree directly. However, we
used the --reset parameter instead of "-m", which turns off
the safety features.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-03 12:35:39 -07:00
Junio C Hamano 44ec754dc7 Merge branch 'jc/index-update-if-able' into maint
* jc/index-update-if-able:
  update $GIT_INDEX_FILE when there are racily clean entries
  diff/status: refactor opportunistic index update
2011-04-03 12:33:05 -07:00
Junio C Hamano be57695d77 Merge branch 'lt/default-abbrev' into maint
* lt/default-abbrev:
  Rename core.abbrevlength back to core.abbrev
  Make the default abbrev length configurable
2011-04-03 12:32:51 -07:00
Junio C Hamano 3967c995ee Merge branch 'jc/maint-rev-list-culled-boundary' into maint
* jc/maint-rev-list-culled-boundary:
  list-objects.c: don't add an unparsed NULL as a pending tree

Conflicts:
	list-objects.c
2011-04-03 12:32:35 -07:00
Junio C Hamano 1030536153 Merge branch 'mm/maint-log-n-with-diff-filtering' into maint
* mm/maint-log-n-with-diff-filtering:
  log: fix --max-count when used together with -S or -G
2011-04-03 12:31:59 -07:00
Junio C Hamano c3d1a4368a Merge branch 'jk/format-patch-multiline-header' into maint
* jk/format-patch-multiline-header:
  format-patch: rfc2047-encode newlines in headers
  format-patch: wrap long header lines
  strbuf: add fixed-length version of add_wrapped_text
2011-04-03 12:31:19 -07:00
Junio C Hamano 7a4750a578 Merge branch 'jn/maint-instaweb-plack-fix' into maint
* jn/maint-instaweb-plack-fix:
  git-instaweb: Change how gitweb.psgi is made runnable as standalone app
2011-04-03 12:30:58 -07:00
Junio C Hamano 625589b5be Merge branch 'lp/config-vername-check' into maint
* lp/config-vername-check:
  Disallow empty section and variable names
  Sanity-check config variable names
2011-04-03 12:29:45 -07:00
Jonathan Nieder ebae9ff95d compat: add missing #include <sys/resource.h>
Starting with commit c793430 (Limit file descriptors used by packs,
2011-02-28), git uses getrlimit to tell how many file descriptors it
can use.  Unfortunately it does not include the header declaring that
function, resulting in compilation errors:

 sha1_file.c: In function 'open_packed_git_1':
 sha1_file.c:718: error: storage size of 'lim' isn't known
 sha1_file.c:721: warning: implicit declaration of function 'getrlimit'
 sha1_file.c:721: error: 'RLIMIT_NOFILE' undeclared (first use in this function)
 sha1_file.c:718: warning: unused variable 'lim'

The standard header to include for this is <sys/resource.h> (which on
some systems itself requires declarations from <sys/types.h> or
<sys/time.h>).  Probably the problem was missed until now because in
current glibc sys/resource.h happens to be included by sys/wait.h.

MinGW does not provide sys/resource.h (and compat/mingw takes care of
providing getrlimit some other way), so add the missing #include to
the "#ifndef __MINGW32__" block in git-compat-util.h.

Reported-by: Stefan Sperling <stsp@stsp.name>
Tested-by: Stefan Sperling <stsp@stsp.name> [on OpenBSD]
Tested-by: Arnaud Lacombe <lacombar@gmail.com> [on FreeBSD 8]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-03 12:21:34 -07:00
Junio C Hamano d83a831bf4 Git 1.7.4.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-03 00:12:31 -07:00
Junio C Hamano c14f372791 Doc: mention --delta-base-offset is the default for Porcelain commands
The underlying pack-objects plumbing command still needs an explicit
option from the command line, but these days Porcelain passes the
option, so there is no need for end users to worry about it anymore.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-02 23:08:13 -07:00
Junio C Hamano 094574b32b Merge branch 'nd/index-doc' into maint
* nd/index-doc:
  doc: technical details about the index file format
  doc: technical details about the index file format
2011-04-01 16:23:55 -07:00
Junio C Hamano 2aa5b6b6c0 Merge branch 'pk/stash-apply-status-relative' into maint
* pk/stash-apply-status-relative:
  Add test: git stash shows status relative to current dir
  git stash: show status relative to current directory
2011-04-01 16:23:43 -07:00
Junio C Hamano bcf3d1fd9c Merge branch 'jc/maint-diff-q-filter' into maint
* jc/maint-diff-q-filter:
  diff --quiet: disable optimization when --diff-filter=X is used
2011-04-01 16:23:34 -07:00
Junio C Hamano bf87e09325 Merge branch 'js/maint-stash-index-copy' into maint
* js/maint-stash-index-copy:
  stash: copy the index using --index-output instead of cp -p
  stash: fix incorrect quoting in cleanup of temporary files
2011-04-01 16:23:21 -07:00
Junio C Hamano b7f6afe2df Merge branch 'mg/doc-bisect-tweak-worktree' into maint
* mg/doc-bisect-tweak-worktree:
  git-bisect.txt: example for bisecting with hot-fix
  git-bisect.txt: streamline run presentation
2011-04-01 16:23:15 -07:00
Junio C Hamano ac53196d9a Merge branch 'jh/maint-do-not-track-non-branches' into maint
* jh/maint-do-not-track-non-branches:
  branch/checkout --track: Ensure that upstream branch is indeed a branch
2011-04-01 16:20:45 -07:00
Junio C Hamano f35bb7c38d Merge branch 'fk/maint-cvsimport-early-failure' into maint
* fk/maint-cvsimport-early-failure:
  git-cvsimport.perl: Bail out right away when reading from the server fails
2011-04-01 16:20:24 -07:00
Junio C Hamano 4584c94f0e Merge branch 'jc/maint-apply-report-offset' into maint
* jc/maint-apply-report-offset:
  apply -v: show offset count when patch did not apply exactly
2011-04-01 16:20:19 -07:00
Junio C Hamano b46c9fafcf Merge branch 'jc/maint-apply-no-double-patch' into maint
* jc/maint-apply-no-double-patch:
  apply: do not patch lines that were already patched
2011-04-01 16:20:11 -07:00
Junio C Hamano 46a1f0728c Merge branch 'js/checkout-untracked-symlink' into maint
* js/checkout-untracked-symlink:
  do not overwrite untracked symlinks
  Demonstrate breakage: checkout overwrites untracked symlink with directory
2011-04-01 16:19:03 -07:00
Junio C Hamano d12d8ec9d7 Merge "checkout ambiguous ref bugfix" into maint
* commit '0cb6ad3':
  checkout: fix bug with ambiguous refs
2011-04-01 16:16:51 -07:00
Jeff King 6cb0186a41 docs: fix filter-branch subdir example for exotic repo names
The GIT_INDEX_FILE variable we get from git has the full
path to the repo, which may contain spaces. When we use it
in our shell snippet, it needs to be quoted.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-01 12:17:45 -07:00
Junio C Hamano 2352570bf4 parse-remote: typofix
An earlier patch had a trivial typo that two people did not notice.
Pointed out by Michael Schubert.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 19:33:41 -07:00
Maxin john 806e0aba2e contrib/thunderbird-patch-inline: do not require bash to run the script
The script does not have to be run under bash, but any POSIX compliant
shell would do, as it does not use any bash-isms.

It may be written under a different style than what is recommended in
Documentation/CodingGuidelines, but that is a different matter.

While at it, fix obvious typos in the comment.

Signed-off-by: Maxin B. John <maxin@maxinbjohn.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 12:29:39 -07:00
Junio C Hamano 4b705f4052 t8001: check the exit status of the command being tested
Avoid running the command being tested as an upstream of a pipe;
doing so will lose its exit status.

While at it, modernise the style of the script.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 12:22:05 -07:00
Michael Witten e0390119b2 strbuf.h: remove a tad stale docs-in-comment and reference api-doc instead
Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 12:02:50 -07:00
Michael Witten 63d3294593 Typos: t/README
Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 11:59:52 -07:00
Carlos Martín Nieto 18b19e443b Documentation/config.txt: make truth value of numbers more explicit
Change the order to 1/0 to have the same true/false order as the rest
of the possibilities for a boolean variable in order not not confuse
users.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 11:44:59 -07:00
Stephen Boyd 2f8ee02c49 git-pack-objects.txt: fix grammatical errors
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 11:43:15 -07:00
Stephen Boyd 9ecd3ada6d parse-remote: replace unnecessary sed invocation
Just use parameter expansion instead.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30 11:42:08 -07:00
Alex Riesen 90cff968b3 HOME must be set before calling git-init when creating test repositories
Otherwise the created test repositories will be affected by users ~/.gitconfig.
For example, setting core.logAllrefupdates in users config will make all
calls to "git config --unset core.logAllrefupdates" fail which will break
the first test which uses the statement and expects it to succeed.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-29 01:13:36 -07:00
Michael Witten f1723ee6b3 git tag documentation grammar fixes and readability updates
... with help from Eric Raible.

In addition, describe the use of GIT_COMMITTER_DATE more comprehensively
by including "date-formats.txt"

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-28 14:14:45 -07:00
Joe Ratterman 7d6cb10b84 grep: Add the option '--line-number'
This is a synonym for the existing '-n' option, matching GNU grep.

Signed-off-by: Joe Ratterman <jratt0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-28 14:02:12 -07:00
Junio C Hamano 78bc466753 Git 1.7.4.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 17:56:14 -07:00
Jakub Narebski 2b1e17237b gitweb: Fix handling of fractional timezones in parse_date
Fractional timezones, like -0330 (NST used in Canada) or +0430
(Afghanistan, Iran DST), were not handled properly in parse_date; this
means values such as 'minute_local' and 'iso-tz' were not generated
correctly.

This was caused by two mistakes:

* sign of timezone was applied only to hour part of offset, and not
  as it should be also to minutes part (this affected only negative
  fractional timezones).

* 'int $h + $m/60' is 'int($h + $m/60)' and not 'int($h) + $m/60',
  so fractional part was discarded altogether ($h is hours, $m is
  minutes, which is always less than 60).

Note that positive fractional timezones +0430, +0530 and +1030 can be
found as authortime in git.git repository itself.

For example http://repo.or.cz/w/git.git/commit/88d50e7 had authortime
of "Fri, 8 Jan 2010 18:48:07 +0000 (23:48 +0530)", which is not marked
with 'atnight', when "git show 88d50e7" gives correct author date of
"Sat Jan 9 00:18:07 2010 +0530".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 13:27:05 -07:00
Junio C Hamano 23fcc98f7f doc: technical details about the index file format
* Clarify "string of unsigned bytes";

 * Blob has two variants (regular file vs symlink), not (blob vs symlink);

 * Clarify permission mode bits;

 * Clarify ce_namelen() "too long to fit in the length field" case;

 * Clarify "." etc are forbidden as path components;

 * Match the description with the internal wording "cache-tree";

 * All types of extension begin with signature and length as explained in
   the first part. Don't repeat the "length" part in the description of
   each extension (can be mistaken as if there is a separate 32-bit size
   field inside the extension), but state what the signature for each
   extension is.

 * Don't say "Extension tag", as we have said "Extension signature" in the
   first part---be consistent;

 * Clarify the invalidation of cache-tree entries;

 * Correct description on subtree_nr field in the cache-tree;

 * Clarify the order of entries in cache-tree;

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-23 15:57:10 -07:00
SZEDER Gábor b5f306fbe1 git-am.txt: advertise 'git am --abort' instead of 'rm .git/rebase-apply'
'git am --abort' is around for quite a long time now, and users should
normally not poke around inside the .git directory, yet the
documentation of 'git am' still recommends the following:

  ... if you decide to start over from scratch,
  run `rm -f -r .git/rebase-apply` ...

Suggest 'git am --abort' instead.

It's not quite the same as the original, because 'git am --abort' will
restore the original branch, while simply removing '.git/rebase-apply'
won't, but that's rather a thinko in the original wording, because
that won't actually "start over _from scratch_".

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-22 14:31:21 -07:00
Junio C Hamano 483fbe2b7c update $GIT_INDEX_FILE when there are racily clean entries
Traditional "opportunistic index update" done by read-only "diff" and
"status" was about updating cached lstat(2) information in the index for
the next round.  We missed another obvious optimization opportunity: when
there are racily clean entries that will cease to be racily clean by
updating $GIT_INDEX_FILE.  Detect that case and write $GIT_INDEX_FILE out
to give it a newer timestamp.

Noticed by Lasse Makholm by stracing "git status" in a fresh checkout and
counting the number of open(2) calls.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-21 14:49:46 -07:00
Junio C Hamano ccdc4ec304 diff/status: refactor opportunistic index update
When we had to refresh the index internally before running diff or status,
we opportunistically updated the $GIT_INDEX_FILE so that later invocation
of git can use the lstat(2) we already did in this invocation.

Make them share a helper function to do so.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-21 12:43:10 -07:00
Jeff King c4e4644e17 bisect: visualize with git-log if gitk is unavailable
If gitk is not available in the PATH, bisect ends up
exiting with the shell's 127 error code, confusing the git
wrapper into thinking that bisect is not a git command.

We already fallback to git-log if there doesn't seem to be a
graphical display available. We should do the same if gitk
is not available in our PATH at all. This not only fixes the
ugly error message, but is a much more sensible default than
failing to show the user anything.

Reported by Maxin John.

Tested-by: Maxin B. John <maxin@maxinbjohn.info>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-21 10:23:45 -07:00
Junio C Hamano a71f09fe3e Rename core.abbrevlength back to core.abbrev
It corresponds to --abbrev=$n command line option after all.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-20 22:26:24 -07:00
Junio C Hamano d98f24cd9d Update draft release notes to 1.7.4.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-20 22:14:21 -07:00
Junio C Hamano 0bd20f10ea Merge branch 'sp/maint-fd-limit' into maint
* sp/maint-fd-limit:
  sha1_file.c: Don't retain open fds on small packs
  mingw: add minimum getrlimit() compatibility stub
  Limit file descriptors used by packs
2011-03-20 22:11:46 -07:00
Junio C Hamano dd7d0d0976 Merge branch 'mr/hpux' into maint
* mr/hpux:
  git-compat-util.h: Honor HP C's noreturn attribute
  Makefile: add NO_FNMATCH_CASEFOLD to HP-UX section
2011-03-20 22:11:15 -07:00
Junio C Hamano 106040fe8e Merge branch 'so/submodule-no-update-first-time' into maint
* so/submodule-no-update-first-time:
  t7406: "git submodule update {--merge|--rebase]" with new submodules
  submodule: no [--merge|--rebase] when newly cloned
2011-03-20 22:11:02 -07:00
Junio C Hamano eec8a512bc Merge branch 'mo/perl-bidi-pipe-envfix' into maint
* mo/perl-bidi-pipe-envfix:
  perl: command_bidi_pipe() method should set-up git environmens
2011-03-20 22:10:31 -07:00
Junio C Hamano a8e04ddf6e Merge branch 'ae/better-template-failure-report' into maint
* ae/better-template-failure-report:
  Improve error messages when temporary file creation fails
2011-03-20 22:09:39 -07:00