1
0
mirror of https://github.com/git/git.git synced 2024-10-20 01:48:55 +02:00
Commit Graph

1531 Commits

Author SHA1 Message Date
Junio C Hamano
1392a37721 diff: a submodule not checked out is not modified
948dd34 (diff-index: careful when inspecting work tree items, 2008-03-30)
made the work tree check careful not to be fooled by a new directory that
exists at a place the index expects a blob.  For such a change to be a
typechange from blob to submodule, the new directory has to be a
repository.

However, if the index expects a submodule there, we should not insist the
work tree entity to be a repository --- a simple directory that is not a
full fledged repository (even an empty directory would do) should be
considered an unmodified subproject, because that is how a superproject
with a submodule is checked out sparsely by default.

This makes the function check_work_tree_entity() even more careful not to
report a submodule that is not checked out as removed.  It fixes the
recently added test in t4027.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Ping Yin
27bfd950c1 Add t7506 to test submodule related functions for git-status
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Ping Yin
7c08a2a637 t4027: test diff for submodule with empty directory
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Alex Riesen
97ad535b01 Use the modern syntax of git-diff-files in t2002-checkout-cache-u.sh
As a nice side effect it also fixes t2002-checkout-cache-u.sh on FreeBSD 4,
/bin/sh of which has problems interpreting "! command" construction.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Junio C Hamano
633d1fe9d0 Merge branch 'maint'
* maint:
  clone: detect and fail on excess parameters
  Remove 'header' from --signoff option description
2008-04-27 21:47:51 -07:00
Junio C Hamano
a2b26acd7a clone: detect and fail on excess parameters
"git clone [options] $src $dst excess-garbage" simply ignored
excess-garbage without giving any diagnostic message.  Fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-27 21:47:39 -07:00
Junio C Hamano
36c79d2bf8 Merge branch 'ho/shared'
* ho/shared:
  Make core.sharedRepository more generic
2008-04-25 12:17:45 -07:00
Junio C Hamano
049a226fa1 Merge branch 'maint'
* maint:
  remote: create fetch config lines with '+'
  push: allow unqualified dest refspecs to DWIM
  doc/git-gc: add a note about what is collected
  t5516: remove ambiguity test (1)
  Linked glossary from cvs-migration page
  write-tree: properly detect failure to write tree objects
2008-04-24 22:40:02 -07:00
Jeff King
1ce89cc4bb remote: create fetch config lines with '+'
Since git-remote always uses remote tracking branches, it
should be safe to always force updates of those branches.
I.e., we should generate

  fetch = +refs/heads/*:refs/remotes/$remote/*

instead of

  fetch = refs/heads/*:refs/remotes/$remote/*

This was the behavior of the perl version, which seems to
have been lost in the C rewrite.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-24 22:30:31 -07:00
Jeff King
f8aae12034 push: allow unqualified dest refspecs to DWIM
Previously, a push like:

  git push remote src:dst

would go through the following steps:

  1. check for an unambiguous 'dst' on the remote; if it
     exists, then push to that ref
  2. otherwise, check if 'dst' begins with 'refs/'; if it
     does, create a new ref
  3. otherwise, complain because we don't know where in the
     refs hierarchy to put 'dst'

However, in some cases, we can guess about the ref type of
'dst' based on the ref type of 'src'. Specifically, before
complaining we now check:

  2.5. if 'src' resolves to a ref starting with refs/heads
       or refs/tags, then prepend that to 'dst'

So now this creates a new branch on the remote, whereas it
previously failed with an error message:

  git push master:newbranch

Note that, by design, we limit this DWIM behavior only to
source refs which resolve exactly (including symrefs which
resolve to existing refs). We still complain on a partial
destination refspec if the source is a raw sha1, or a ref
expression such as 'master~10'.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-24 22:13:24 -07:00
Junio C Hamano
31c6390d40 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  t5516: remove ambiguity test (1)
  Linked glossary from cvs-migration page
  write-tree: properly detect failure to write tree objects
2008-04-24 21:50:48 -07:00
Jeff King
3ef6a1fe95 t5516: remove ambiguity test (1)
This test tried to push into a remote with ambiguous refs in
remotes/$x/master and remotes/$y/master. However, the remote
never actually tells us about the refs/remotes hierarchy, so
we don't even see this ambiguity.

The test happened to pass because we were simply looking for
failure, and the test fails for another reason: the dst
refspec does not exist and does not begin with refs/, making
it invalid.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-23 10:56:07 -07:00
Junio C Hamano
edae5f0c20 write-tree: properly detect failure to write tree objects
Tomasz Fortuna reported that "git commit" does not error out properly when
it cannot write tree objects out.  "git write-tree" shares the same issue,
as the failure to notice the error is deep in the logic to write tree
objects out recursively.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-23 10:02:44 -07:00
Junio C Hamano
57cf5ca305 Merge branch 'maint'
* maint:
  Amend git-push refspec documentation
  git-gc --prune is deprecated
  svn-git: Use binmode for reading/writing binary rev maps
  diff options documentation: refer to --diff-filter in --name-status
  Don't force imap.host to be set when imap.tunnel is set
  git-clone.txt: Adjust note to --shared for new pruning behavior of git-gc
  git-svn bug with blank commits and author file
  archive.c: format_subst - fixed bogus argument to memchr
  copy.c: copy_fd - correctly report write errors
  gitattributes: Fix subdirectory attributes specified from root directory
2008-04-23 00:03:56 -07:00
Junio C Hamano
d6958a1a32 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  svn-git: Use binmode for reading/writing binary rev maps
  diff options documentation: refer to --diff-filter in --name-status
  git-svn bug with blank commits and author file
  archive.c: format_subst - fixed bogus argument to memchr
  copy.c: copy_fd - correctly report write errors
  gitattributes: Fix subdirectory attributes specified from root directory
2008-04-22 23:37:06 -07:00
Matthew Ogilvie
82881b3823 gitattributes: Fix subdirectory attributes specified from root directory
Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-22 21:12:37 -07:00
Junio C Hamano
41a3e3aa9b Merge branch 'jc/maint-rebase-am' into maint
* jc/maint-rebase-am:
  rebase: do not munge commit log message

Conflicts:

	git-am.sh
2008-04-19 23:01:51 -07:00
Junio C Hamano
3642617ee7 Merge branch 'py/submodule'
* py/submodule:
  builtin-status: Add tests for submodule summary
  builtin-status: submodule summary support
  git-submodule summary: --for-status option
2008-04-19 21:11:29 -07:00
Junio C Hamano
8876046037 Merge branch 'jc/maint-rebase-am'
* jc/maint-rebase-am:
  rebase: do not munge commit log message

Conflicts:

	git-am.sh
2008-04-19 00:25:15 -07:00
Junio C Hamano
d9f39d9838 Merge branch 'maint'
* maint:
  gitweb: Fix 'history' view for deleted files with history
  Document that WebDAV doesn't need git on the server, and works over SSL
  git-remote: reject adding remotes with invalid names
  am: POSIX portability fix
2008-04-18 22:58:32 -07:00
Jakub Narebski
5634cf2476 gitweb: Fix 'history' view for deleted files with history
When asked for history of a file which is not present in given branch
("HEAD", i.e. current branch, or given by transient $hash_hase ('hb')
parameter), but is present deeper in the history (meaning that "git
rev-list --full-history $hash_base -- $file_name" is not empty), and
there is no $hash ('h') parameter set for a file, gitweb would spew
multiple of "Use of uninitialized value" warnings, and some links
would be missing.  This commit fixes this bug.

This bug occurs in the rare cases when "git log -- <path>" is empty
and "git log --full-history -- <path>" is not, or to be more exact in
the cases when full-history starts later than given branch.  It can
happen if you are using handcrafted gitwb URL, or if you follow
generic 'history' link or bookmark for a file which got deleted.

Gitweb tried to get file type ('tree', or 'blob', or even 'commit')
from the commit we start searching from (where the file was not
present), and not among found commits.  This was the cause of "Use of
uninitialized value" warnings.

This commit also add tests for such situation to t9500 test.

While we are it, return HTTP error if there is _no_ history; it means
that file or directory was not found (for given branch).  Also error
out if type of item could not be found: it should not happen now, but
better be sure.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-18 22:10:38 -07:00
Jonas Fonseca
24b6177e02 git-remote: reject adding remotes with invalid names
This can happen if the arguments to git-remote add is switched by the
user, and git would only show an error if fetching was also requested.
Fix it by using the refspec parsing engine to check if the requested
name can be parsed as a remote before add it.

Also cleanup so that the "remote.<name>.url" config name buffer is only
initialized once.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-18 16:31:27 -07:00
Heikki Orsila
06cbe85503 Make core.sharedRepository more generic
git init --shared=0xxx, where '0xxx' is an octal number, will create
a repository with file modes set to '0xxx'. Users with a safe umask
value (0077) can use this option to force file modes. For example,
'0640' is a group-readable but not group-writable regardless of
user's umask value. Values compatible with old Git versions are written
as they were before, for compatibility reasons. That is, "1" for
"group" and "2" for "everybody".

"git config core.sharedRepository 0xxx" is also handled.

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 18:23:54 -07:00
Junio C Hamano
5e835cac86 rebase: do not munge commit log message
Traditionally git-rebase was implemented in terms of "format-patch" piped
to "am -3", to strike balance between speed (because it avoids a rather
expensive read-tree/merge-recursive machinery most of the time) and
flexibility (the magic "-3" allows it to fall back to 3-way merge as
necessary).  However, this combination has one flaw when dealing with a
nonstandard commit log message format that has more than one lines in the
first paragraph.

This teaches "git am --rebasing" to take advantage of the fact that the
mbox message "git rebase" prepares for it records the original commit
object name, to get the log message from the original commit object
instead.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 12:50:48 -07:00
Junio C Hamano
a17b1d2f0b Merge branch 'maint'
* maint:
  git-bisect: make "start", "good" and "skip" succeed or fail atomically
  git-am: cope better with an empty Subject: line
  Ignore leading empty lines while summarizing merges
  bisect: squelch "fatal: ref HEAD not a symref" misleading message
  builtin-apply: Show a more descriptive error on failure when opening a patch
  Clarify documentation of git-cvsserver, particularly in relation to git-shell
2008-04-16 00:45:52 -07:00
Junio C Hamano
464509f790 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  git-bisect: make "start", "good" and "skip" succeed or fail atomically
  git-am: cope better with an empty Subject: line
  Ignore leading empty lines while summarizing merges
  bisect: squelch "fatal: ref HEAD not a symref" misleading message
  builtin-apply: Show a more descriptive error on failure when opening a patch
  Clarify documentation of git-cvsserver, particularly in relation to git-shell
2008-04-16 00:37:33 -07:00
Christian Couder
d3e54c8829 git-bisect: make "start", "good" and "skip" succeed or fail atomically
Before this patch, when "git bisect start", "git bisect good" or
"git bisect skip" were called with many revisions, they could fail
after having already marked some revisions as "good", "bad" or
"skip".

This could be especilally bad for "git bisect start" because as
the file ".git/BISECT_NAMES" would not have been written, there
would have been no attempt to clear the marked revisions on a
"git bisect reset". That's because if there is no
".git/BISECT_NAMES" file, nothing is done to clean things up, as
the bisect session is not supposed to have started.

While at it, let's also create the ".git/BISECT_START" file, only
after ".git/BISECT_NAMES" as been created.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 00:11:37 -07:00
Junio C Hamano
189d6b8bfa Merge branch 'maint'
* maint:
  git clean: Add test to verify directories aren't removed with a prefix
  git clean: Don't automatically remove directories when run within subdirectory
  git-submodule - possibly use branch name to describe a module
2008-04-14 23:15:09 -07:00
Shawn Bohrer
2b6f0b0a78 git clean: Add test to verify directories aren't removed with a prefix
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-14 23:14:58 -07:00
Junio C Hamano
c35b0b5884 Fix git_config_bool_or_int
The earlier one botched the return value logic between config_bool and
config_bool_and_int.  The former should normalize between 0 and 1 while
the latter should give back full range of integer values.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-13 12:11:11 -07:00
Ping Yin
e5e4a7f23d builtin-status: Add tests for submodule summary
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 20:00:45 -07:00
Ping Yin
d0f64dd44d git-submodule summary: --for-status option
The --for-status option is mainly used by builtin-status/commit.
It adds 'Modified submodules:' line at top and  '# ' prefix to all
following lines.

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 20:00:45 -07:00
Junio C Hamano
f43e2fd43b Merge branch 'maint'
* maint:
  t7401: squelch garbage output
  Documentation/git-submodule: typofix
  Fix config key miscount in url.*.insteadOf
  Docs gitk: Explicitly mention the files that gitk uses (~/.gitk)
  Document -w option to shortlog
  bisect: report bad rev better
2008-04-12 19:17:51 -07:00
Junio C Hamano
02604e293a t7401: squelch garbage output
The script had an unconditional output done outside of test_expect_*
construct, which leaked out and contaminated the output without -v.
Squelch it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 18:57:08 -07:00
Daniel Barkalow
60e3aba9c3 Fix config key miscount in url.*.insteadOf
Also tighten test to require it to be correct.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 15:41:24 -07:00
Junio C Hamano
4cdda2b895 Merge branch 'maint'
* maint:
  bisect: fix bad rev checking in "git bisect good"
  revision.c: make --date-order overriddable
  git-submodule: Avoid 'fatal: cannot describe' message
  Force the medium pretty format on calls to git log
  Fix section about backdating tags in the git-tag docs
  Document option --only of git commit
  Documentation/git-request-pull: Fixed a typo ("send" -> "end")
2008-04-11 23:56:09 -07:00
Junio C Hamano
eed81838f0 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  bisect: fix bad rev checking in "git bisect good"
  revision.c: make --date-order overriddable
  Fix section about backdating tags in the git-tag docs
  Document option --only of git commit
  Documentation/git-request-pull: Fixed a typo ("send" -> "end")
2008-04-11 23:55:55 -07:00
Christian Couder
e3389075c6 bisect: fix bad rev checking in "git bisect good"
It seems that "git bisect good" and "git bisect skip" have never
properly checked arguments that have been passed to them. As soon
as one of them can be parsed as a SHA1, no error or warning would
be given.

This is because 'git rev-parse --revs-only --no-flags "$@"' always
"exit 0" and outputs all the SHA1 it can found from parsing "$@".

This patch fix this by using, for each "bisect good" argument, the
same logic as for the "bisect bad" argument.

While at it, this patch teaches "bisect bad" to give a meaningfull
error message when it is passed more than one argument.

Note that if "git bisect good" or "git bisect skip" is given some
proper revs and then something that is not a proper rev, then the
first proper revs will still have been marked as "good" or "skip".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 23:54:45 -07:00
Junio C Hamano
71349732c5 Merge branch 'maint'
* maint:
  git-fetch: fix status output when not storing tracking ref
  core-tutorial.txt: Fix showing the current behaviour.
  git-archive: ignore prefix when checking file attribute
  Fix documentation syntax of optional arguments in short options.
2008-04-10 00:47:04 -07:00
Junio C Hamano
179c94b24a Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  core-tutorial.txt: Fix showing the current behaviour.
  git-archive: ignore prefix when checking file attribute
  Fix documentation syntax of optional arguments in short options.
2008-04-10 00:29:33 -07:00
René Scharfe
ac7fa2776c git-archive: ignore prefix when checking file attribute
Ulrik Sverdrup noticed that git-archive doesn't correctly apply the attribute
export-subst when the option --prefix is given, too.

When it checked if a file has the attribute turned on, git-archive would try
to look up the full path -- including the prefix -- in .gitattributes.  That's
wrong, as the prefix doesn't need to have any relation to any existing
directories, tracked or not.

This patch makes git-archive ignore the prefix when looking up if value of the
attribute export-subst for a file.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-10 00:20:38 -07:00
Junio C Hamano
3c993de9f2 Merge branch 'mk/unpack-careful'
* mk/unpack-careful:
  t5300: add test for "index-pack --strict"
  receive-pack: allow using --strict mode for unpacking objects
  unpack-objects: fix --strict handling
  t5300: add test for "unpack-objects --strict"
  unpack-objects: prevent writing of inconsistent objects
2008-04-09 00:44:17 -07:00
Junio C Hamano
ce47dc0775 Merge branch 'jk/add-i-mode'
* jk/add-i-mode:
  add--interactive: allow user to choose mode update
  add--interactive: ignore mode change in 'p'atch command
2008-04-09 00:29:24 -07:00
Eric Wong
f61cc48d28 git-svn: fix following renamed paths when tracking a single path
When using git-svn to follow only a single (empty) path per
svn-remote (i.e. not using --stdlayout), following the history
of a renamed path was broken in
c586879cdfa4f8181a14e953a9152a4639eef333.

This reverts the regression for the single (emtpy) path per
svn-remote case.

To avoid breaking the tests in a committed revision, this is an
addendum to a patch originally submitted by

  Santhosh Kumar Mani <santhoshmani@gmail.com>:
  > git-svn: add test for renamed directory fetch
  >
  > This test tries to fetch a directory which had renames in the
  > history from a SVN repository.

  [ew: unneccesary dependency on the starting an HTTP server
   removed from Santhosh's original test.]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-07 00:16:08 -07:00
Junio C Hamano
a1c0dca43a Merge branch 'jc/maint-apply-match-beginning'
* jc/maint-apply-match-beginning:
  Fix "git apply" to correctly enforce "match at the beginning"
2008-04-06 20:04:29 -07:00
Christian Couder
f2b3e3c722 test suite: remove useless TERM cruft in "t7005-editor.sh"
In commit 15387e3 (Test suite: reset TERM to its previous value after
testing., 2007-10-26), I added a workaround to reset TERM to its previous
value before the "test_done" at the end of "t7005-editor.sh" because
otherwise "test_done" would have printed the test result with a bad TERM
env variable (this resulted in output with no color on konsole).

But since commit c2116a1 (test-lib: fix TERM to dumb for test
repeatability, 2008-03-06), colored output is printed in a subshell with
TERM reset to its original value so the earlier workaround is not needed
anymore.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-06 20:02:43 -07:00
Junio C Hamano
ee5a317e01 Fix "git apply" to correctly enforce "match at the beginning"
An earlier commit 4be6096 (apply --unidiff-zero: loosen sanity checks for
--unidiff=0 patches, 2006-09-17) made match_beginning and match_end
computed incorrectly.  If a hunk inserts at the beginning, old position
recorded at the hunk is line 0, and if a hunk changes at the beginning, it
is line 1.  The new test added to t4104 exposes that the old code did not
insist on matching at the beginning for a patch to add a line to an empty
file.

An even older 65aadb9 (apply: force matching at the beginning.,
2006-05-24) was equally wrong in that it tried to take hints from the
number of leading context lines, to decide if the hunk must match at the
beginning, but we can just look at the line number in the hunk to decide.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-06 19:21:45 -07:00
Junio C Hamano
eedb9d9eab Merge branch 'js/filter-branch'
* js/filter-branch:
  filter-branch: Fix renaming a directory in the tree-filter
  filter-branch: Test renaming directories in a tree-filter
2008-04-02 11:13:23 -07:00
Junio C Hamano
5fbd0a44cf Merge branch 'bc/mktag'
* bc/mktag:
  mktag.c: tweak validation of tagger field and adjust test script
  mktag.c: improve verification of tagger field and tests
2008-04-02 00:23:19 -07:00
Junio C Hamano
22e885e6d8 Merge branch 'dd/cvsserver'
* dd/cvsserver:
  cvsserver: Use the user part of the email in log and annotate results
  cvsserver: Add test for update -p
  cvsserver: Implement update -p (print to stdout)
  cvsserver: Add a few tests for 'status' command
  cvsserver: Do not include status output for subdirectories if -l is passed
  cvsserver: Only print the file part of the filename in status header
  cvsserver: Respond to the 'editors' and 'watchers' commands
2008-04-02 00:22:15 -07:00