1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 06:47:52 +01:00
Commit graph

23622 commits

Author SHA1 Message Date
Matthieu Prat
b894d3e788 t7060: actually test "git diff-index --cached -M"
A test was designed for "git diff-index --cached -M" but the command is
run without the "-M" option (which makes the test essentially identical
to its preceding counterpart).

Signed-off-by: Matthieu Prat <matthieuprat@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-02 12:23:30 -07:00
Martin von Zweigbergk
d7c9bf2235 diffcore-rename: don't consider unmerged path as source
Since e9c8409 (diff-index --cached --raw: show tree entry on the LHS for
unmerged entries., 2007-01-05), an unmerged entry should be detected by
using DIFF_PAIR_UNMERGED(p), not by noticing both one and two sides of
the filepair records mode=0 entries. However, it forgot to update some
parts of the rename detection logic.

This only makes difference in the "diff --cached" codepath where an
unmerged filepair carries information on the entries that came from the
tree.  It probably hasn't been noticed for a long time because nobody
would run "diff -M" during a conflict resolution, but "git status" uses
rename detection when it internally runs "diff-index" and "diff-files"
and gives nonsense results.

In an unmerged pair, "one" side can have a valid filespec to record the
tree entry (e.g. what's in HEAD) when running "diff --cached". This can
be used as a rename source to other paths in the index that are not
unmerged. The path that is unmerged by definition does not have the
final content yet (i.e. "two" side cannot have a valid filespec), so it
can never be a rename destination.

Use the DIFF_PAIR_UNMERGED() to detect unmerged filepair correctly, and
allow the valid "one" side of an unmerged filepair to be considered a
potential rename source, but never to be considered a rename destination.

Commit message and first two test cases by Junio, the rest by Martin.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-23 22:44:22 -07:00
Junio C Hamano
da656f17d3 Merge branch 'maint-1.7.2' into maint-1.7.3
* maint-1.7.2:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command
2011-02-16 14:32:59 -08:00
Junio C Hamano
6a7f71d376 Merge branch 'maint-1.7.1' into maint-1.7.2
* maint-1.7.1:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command
2011-02-16 14:32:54 -08:00
Junio C Hamano
206af7c96b Merge branch 'maint-1.7.0' into maint-1.7.1
* maint-1.7.0:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command
2011-02-16 14:32:47 -08:00
Jonathan Nieder
547e8b9205 fast-import: introduce "feature notes" command
Here is a 'feature' command for streams to use to require support for
the notemodify (N) command.

When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4,
2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8,
2009-10-09) and it was not obvious it deserved to be a named feature.
But now that is clear, since all major non-git fast-import backends
lack support for it.

Details: on git version with this patch applied, any "feature notes"
command in the features/options section at the beginning of a stream
will be treated as a no-op.  On fast-import implementations without
the feature (and older git versions), the command instead errors out
with a message like

	This version of fast-import does not support feature notes.

So by declaring use of notes at the beginning of a stream, frontends
can avoid wasting time and other resources when the backend does not
support notes.  (This would be especially important for backends that
do not support rewinding history after a botched import.)

Improved-by: Thomas Rast <trast@student.ethz.ch>
Improved-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-09 16:06:51 -08:00
Jonathan Nieder
68595cd442 fast-import: clarify documentation of "feature" command
The "feature" command allows streams to specify options for the import
that must not be ignored.  Logically, they are part of the stream,
even though technically most supported features are synonyms to
command-line options.

Make this more obvious by being more explicit about how the analogy
between most "feature" commands and command-line options works.  Treat
the feature (import-marks) that does not fit this analogy separately.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-09 16:06:47 -08:00
Jonathan Nieder
960ac5ff99 rebase -i: clarify in-editor documentation of "exec"
The hints in the current "instruction sheet" template look like so:

 # Rebase 3f14246..a1d7e01 onto 3f14246
 #
 # Commands:
 #  p, pick = use commit
 #  r, reword = use commit, but edit the commit message
 #  e, edit = use commit, but stop for amending
 #  s, squash = use commit, but meld into previous commit
 #  f, fixup = like "squash", but discard this commit's log message
 #  x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails
 #
 # If you remove a line here THAT COMMIT WILL BE LOST.
 # However, if you remove everything, the rebase will be aborted.
 #

This does not make it clear that the format of each line is

	<insn> <commit id> <explanatory text that will be printed>

but the reader will probably infer that from the automatically
generated pick examples above it.

What about the "exec" instruction?  By analogy, I might imagine that
the format of that line is "exec <command> <explanatory text>", and
the "x <cmd>" hint does not address that question (at first I read it
as taking an argument <cmd> that is the name of a shell).  Meanwhile,
the mention of <cmd> makes the hints harder to scan as a table.

So remove the <cmd> and add some words to remind the reader that
"exec" runs a command named by the rest of the line.  To make room, it
is left to the manpage to explain that that command is run using
$SHELL and that nonzero status from that command will pause the
rebase.

Wording from Junio.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27 10:24:09 -08:00
Jeff King
a1231de002 tests: sanitize more git environment variables
These variables should generally not be set in one's
environment, but they do get set by rebase, which means
doing an interactive rebase like:

  pick abcd1234 foo
  exec make test

will cause false negatives in the test suite.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27 10:24:05 -08:00
Junio C Hamano
5ce3258122 Merge branch 'jn/fast-import-empty-tree-removal' into maint
* jn/fast-import-empty-tree-removal:
  fast-import: treat filemodify with empty tree as delete
2011-01-27 10:23:53 -08:00
Jonathan Nieder
8fe533f686 fast-import: treat filemodify with empty tree as delete
Normal git processes do not allow one to build a tree with an empty
subtree entry without trying hard at it.  This is in keeping with the
general UI philosophy: git tracks content, not empty directories.

v1.7.3-rc0~75^2 (2010-06-30) changed that by making it easy to include
an empty subtree in fast-import's active commit:

	M 040000 4b825dc642 subdir

One can trigger this by reading an empty tree (for example, the tree
corresponding to an empty root commit) and trying to move it to a
subtree.  It is better and more closely analogous to 'git read-tree
--prefix' to treat such commands as requests to remove the subtree.

Noticed-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27 10:22:37 -08:00
Jeff King
4ac5356c62 rebase: give a better error message for bogus branch
When you give a non-existent branch to git-rebase, it spits
out the usage. This can be confusing, since you may
understand the usage just fine, but simply have made a
mistake in the branch name.

Before:

  $ git rebase origin bogus
  Usage: git rebase ...

After:

  $ git rebase origin bogus
  fatal: no such branch: bogus
  Usage: git rebase ...

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-26 17:27:02 -08:00
Jeff King
3b21a438c9 rebase: use explicit "--" with checkout
In the case of a ref/pathname conflict, checkout will
already do the right thing and checkout the ref. However,
for a non-existant ref, this has two advantages:

  1. If a file with that pathname exists, rebase will
     refresh the file from the index and then rebase the
     current branch instead of producing an error.

  2. If no such file exists, the error message using an
     explicit "--" is better:

       # before
       $ git rebase -i origin bogus
       error: pathspec 'bogus' did not match any file(s) known to git.
       Could not checkout bogus

       # after
       $ git rebase -i origin bogus
       fatal: invalid reference: bogus
       Could not checkout bogus

The problems seem to be trigger-able only through "git
rebase -i", as regular git-rebase checks the validity of the
branch parameter as a ref very early on. However, it doesn't
hurt to be defensive.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-26 17:26:58 -08:00
Erik Faye-Lund
b312b4123b exec_cmd: remove unused extern
This definition was added by commit 77cb17e9, but it's left unused since
commit 511707d. Remove the left-over definition.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19 08:27:22 -08:00
Junio C Hamano
14154ce3ca Merge branch 'jn/gitweb-no-logo' into maint
* jn/gitweb-no-logo:
  gitweb: make logo optional
2011-01-19 08:26:47 -08:00
Junio C Hamano
ae830c211b Merge branch 'jk/diff-driver-binary-doc' into maint
* jk/diff-driver-binary-doc:
  docs: explain diff.*.binary option
2011-01-19 08:26:44 -08:00
Junio C Hamano
8a59702ad8 Merge branch 'tr/submodule-relative-scp-url' into maint
* tr/submodule-relative-scp-url:
  submodule: fix relative url parsing for scp-style origin
2011-01-19 08:26:41 -08:00
Junio C Hamano
ea9590789f Merge branch 'rj/maint-difftool-cygwin-workaround' into maint
* rj/maint-difftool-cygwin-workaround:
  difftool: Fix failure on Cygwin
2011-01-19 08:26:24 -08:00
Junio C Hamano
f8d0215c81 Merge branch 'rj/maint-test-fixes' into maint
* rj/maint-test-fixes:
  t9501-*.sh: Fix a test failure on Cygwin
  lib-git-svn.sh: Add check for mis-configured web server variables
  lib-git-svn.sh: Avoid setting web server variables unnecessarily
  t9142: Move call to start_httpd into the setup test
  t3600-rm.sh: Don't pass a non-existent prereq to test #15
2011-01-19 08:26:17 -08:00
Junio C Hamano
305579f78d Merge branch 'jn/maint-gitweb-pathinfo-fix' into maint
* jn/maint-gitweb-pathinfo-fix:
  gitweb: Fix handling of whitespace in generated links
2011-01-19 08:26:04 -08:00
Junio C Hamano
3a1882c1fe Merge branch 'ak/describe-exact' into maint
* ak/describe-exact:
  describe: Delay looking up commits until searching for an inexact match
  describe: Store commit_names in a hash table by commit SHA1
  describe: Do not use a flex array in struct commit_name
  describe: Use for_each_rawref
2011-01-19 08:25:52 -08:00
Junio C Hamano
267684f0b7 Merge branch 'jn/maint-fast-import-object-reuse' into maint
* jn/maint-fast-import-object-reuse:
  fast-import: insert new object entries at start of hash bucket
2011-01-19 08:25:46 -08:00
Junio C Hamano
f326a06497 Merge branch 'jn/submodule-b-current' into maint
* jn/submodule-b-current:
  git submodule: Remove now obsolete tests before cloning a repo
  git submodule -b ... of current HEAD fails
2011-01-19 08:25:41 -08:00
Junio C Hamano
d84f280937 Merge branch 'jc/maint-svn-info-test-fix' into maint
* jc/maint-svn-info-test-fix:
  t9119: do not compare "Text Last Updated" line from "svn info"
2011-01-19 08:25:38 -08:00
Junio C Hamano
0bc6180bcb Merge branch 'nd/maint-relative' into maint
* nd/maint-relative:
  get_cwd_relative(): do not misinterpret root path
2011-01-19 08:25:31 -08:00
Matthieu Moy
3f14246899 commit: suggest --amend --reset-author to fix commiter identity
Since the message advises to fix the configuration first, the
advantage of using this command is that it is cut-and-paste ready,
while using --author='...' requires the user to type his name and
email again.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-12 12:43:58 -08:00
Junio C Hamano
54f4cd9e8c Merge branch 'maint-1.7.2' into maint
* maint-1.7.2:
  Documentation/githooks: post-rewrite-copy-notes never existed
  Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10 10:39:28 -08:00
Junio C Hamano
7a876edf5d Merge branch 'maint-1.7.1' into maint-1.7.2
* maint-1.7.1:
  Documentation/githooks: post-rewrite-copy-notes never existed
  Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10 10:39:18 -08:00
Junio C Hamano
567323d387 Merge branch 'maint-1.7.0' into maint-1.7.1
* maint-1.7.0:
  Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10 10:39:04 -08:00
Jeff King
ab4356111a docs: explain diff.*.binary option
This was added long ago as part of the userdiff refactoring
for textconv, as internally it made the code simpler and
cleaner. However, there was never a concrete use case for
actually using the config variable.

Now that Matthieu Moy has provided such a use case, it's
easy to explain it using his example.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10 10:00:14 -08:00
Thomas Rast
ea640cc691 submodule: fix relative url parsing for scp-style origin
The function resolve_relative_url was not prepared to deal with an
scp-style origin 'user@host:path' in the case where 'path' is only a
single component.  Fix this by extending the logic that strips one
path component from the $remoteurl.

Also add tests for both styles of URLs.

Noticed-by: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10 09:10:54 -08:00
Thomas Rast
920a5d436b Documentation/githooks: post-rewrite-copy-notes never existed
The documentation for the post-rewrite hook contains a paragraph from
its early development, where the automatic notes copying facilities
were not part of the series and thus this had to be a hook.  Later
versions of the series implemented notes copying as a core feature.

Thus mentioning post-rewrite-copy-notes was never correct.  As the
other hooks do not have a "there is no default hook, but..." sentence
unless they ship a sample hook in either templates or contrib, we
simply remove the whole paragraph.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10 09:09:02 -08:00
Thomas Rast
fc7642a096 Documentation/git-archive: spell --worktree-attributes correctly
The --worktree-attributes option was correctly documented in ba053ea
(archive: do not read .gitattributes in working directory,
2009-04-18).  However, later in 9b4c8b0 (archive documentation:
attributes are taken from the tree by default, 2010-02-10) the
misspelling "--work-tree-attributes" was used to refer to it.  Fix
this.

Noticed-by: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10 09:07:24 -08:00
Anders Kaseorg
b393515f8e Mark gitk script executable
The executable bit on gitk-git/gitk was lost (accidentally it seems) by
commit 62ba5143ec.  Put it back, so that
gitk can be run directly from a git.git checkout.

Note that the script is already executable in gitk.git, just not in
git.git.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-08 23:34:02 -08:00
Junio C Hamano
6e97ef31ce Git 1.7.3.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-05 14:49:19 -08:00
Jonathan Nieder
6822052427 gitweb: make logo optional
Some sites may not want to have a logo at all.

While at it, use $cgi->img to simplify this code.  (CGI.pm learned
most HTML4 tags by version 2.79, so this should be portable to perl
5.8, though I haven't tested.)

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04 10:49:32 -08:00
Jonathan Nieder
9d9f5e72dc gitweb: skip logo in atom feed when there is none
With v1.5.0-rc0~169 (gitweb: Fix Atom feed <logo>: it is $logo,
not $logo_url, 2006-12-04), the logo URI to be written to Atom
feeds was corrected but the case of no logo forgotten.

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04 10:48:37 -08:00
Robin H. Johnson
57da204264 t9001: Fix test prerequisites
Add in missing Perl prerequisites for new tests of send-email.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-29 13:39:05 -08:00
Junio C Hamano
17367939eb Prepare for 1.7.3.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28 13:48:54 -08:00
Junio C Hamano
a121d53fa6 Merge branch 'jk/commit-die-on-bogus-ident' into maint
* jk/commit-die-on-bogus-ident:
  commit: die before asking to edit the log message
  ident: die on bogus date format
2010-12-28 13:45:12 -08:00
Junio C Hamano
359f34f6cc Merge branch 'ks/blame-worktree-textconv-cached' into maint
* ks/blame-worktree-textconv-cached:
  fill_textconv(): Don't get/put cache if sha1 is not valid
  t/t8006: Demonstrate blame is broken when cachetextconv is on
2010-12-28 13:44:58 -08:00
Junio C Hamano
58c58c8624 Merge branch 'jc/maint-rebase-rewrite-last-skip' into maint
* jc/maint-rebase-rewrite-last-skip:
  rebase --skip: correctly wrap-up when skipping the last patch
2010-12-28 13:43:10 -08:00
Junio C Hamano
2f73969570 Merge branch 'jc/maint-am-abort-safely' into maint
* jc/maint-am-abort-safely:
  am --abort: keep unrelated commits since the last failure and warn
2010-12-28 13:42:55 -08:00
Junio C Hamano
0ec9ee3bcf Merge branch 'kb/maint-status-cquote' into maint
* kb/maint-status-cquote:
  status: Quote paths with spaces in short format
2010-12-28 13:23:20 -08:00
Robin H. Johnson
5cd3e10737 Fix false positives in t3404 due to SHELL=/bin/false
If the user's shell in NSS passwd is /bin/false (eg as found during Gentoo's
package building), the git-rebase exec tests will fail, because they call
$SHELL around the command, and in the existing testcase, $SHELL was not being
cleared sufficently.

This lead to false positive failures of t3404 on systems where the package
build user was locked down as noted above.

Signed-off-by: "Robin H. Johnson" <robbat2@gentoo.org>
X-Gentoo-Bug: 349083
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=349083
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28 11:22:16 -08:00
Junio C Hamano
26517dea24 Merge branch 'rs/maint-diff-fd-leak' into maint
* rs/maint-diff-fd-leak:
  close file on error in read_mmfile()
2010-12-26 11:18:39 -08:00
René Scharfe
5fd898141c close file on error in read_mmfile()
Reported in http://qa.debian.org/daca/cppcheck/sid/git_1.7.2.3-2.2.html
and in http://thread.gmane.org/gmane.comp.version-control.git/123042.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-26 11:17:18 -08:00
Brandon Casey
c2ed29b49b test-lib.sh/test_decode_color(): use octal not hex in awk script
POSIX awk seems to explicitly not support hexadecimal escape sequences.

From http://pubs.opengroup.org/onlinepubs/009695399/:

   Regular expressions in awk have been extended somewhat...
   One sequence that is not supported is hexadecimal value escapes
   beginning with '\x'.

This affects the awk on IRIX 6.5, and causes t4015.56 to fail.
Use octal instead.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-22 19:46:52 -08:00
Junio C Hamano
ef88ad2387 rebase --skip: correctly wrap-up when skipping the last patch
When "rebase --skip" is used to skip the last patch in the series, the
code to wrap up the rewrite by copying the notes from old to new commits
and also by running the post-rewrite hook was bypassed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-22 16:50:28 -08:00
Jonathan Nieder
77e572653b t0050: fix printf format strings for portability
Unlike bash and ksh, dash passes through hexadecimal \xcc escapes.
So when run with dash, these tests *pass* (since '\xcc' is a perfectly
reasonable filename) but they are not testing what was intended.

Use octal escapes instead, in the spirit of v1.6.1-rc1~55^2
(2008-11-09).

Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-21 13:26:32 -08:00