Commit graph

17022 commits

Author SHA1 Message Date
Johannes Schindelin 466ddf90c2 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>
2009-01-17 18:19:46 -08:00
Johannes Schindelin 20642801e4 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>
2009-01-17 18:19:35 -08:00
Junio C Hamano ebb7bbf769 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
2009-01-15 14:33:54 -08:00
Stephan Beyer f8aa1b6902 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>
2009-01-15 14:22:53 -08:00
Stephan Beyer dc7f55cbe9 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>
2009-01-15 14:22:42 -08:00
Stephan Beyer 944019c8b3 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>
2009-01-15 14:22:12 -08:00
Junio C Hamano eb475bfa05 Update draft release notes to 1.6.1.1 2009-01-14 22:43:04 -08:00
Junio C Hamano 914186a5c3 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"
2009-01-14 22:34:05 -08:00
Miklos Vajna 8dca683346 Make t3411 executable
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14 17:00:00 -08:00
Michael J Gruber be17262d13 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>
2009-01-14 09:34:22 -08:00
Michael J Gruber 3772923f14 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>
2009-01-14 09:29:24 -08:00
Junio C Hamano 4f8b8992ef Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  fast-import: Cleanup mode setting.
  Git.pm: call Error::Simple() properly
2009-01-13 23:10:50 -08:00
Felipe Contreras 3d1d81eba2 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>
2009-01-13 22:57:12 -08:00
Jay Soffian 8faea4f3b2 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>
2009-01-13 22:52:35 -08:00
Junio C Hamano 885a1ffb93 Merge branch 'kk/maint-http-push' into maint
* kk/maint-http-push:
  http-push: support full URI in handle_remote_ls_ctx()
2009-01-13 01:15:49 -08:00
Junio C Hamano 94468bc1f7 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
2009-01-13 01:15:19 -08:00
Junio C Hamano 9e8f6e7f6e 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
2009-01-13 01:13:56 -08:00
Junio C Hamano ae5a97fdd0 Merge branch 'ap/maint-apply-modefix' into maint
* ap/maint-apply-modefix:
  builtin-apply: prevent non-explicit permission changes
2009-01-13 00:56:40 -08:00
Junio C Hamano 1cbe69f649 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
2009-01-13 00:40:19 -08:00
Pierre Habouzit 12dd111288 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>
2009-01-13 00:21:31 -08:00
jidanni@jidanni.org 47a845bfc3 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>
2009-01-12 17:47:36 -08:00
Junio C Hamano 9279bf3ab6 Merge branch 'mh/maint-sendmail-cc-doc' into maint
* mh/maint-sendmail-cc-doc:
  doc/git-send-email: mention sendemail.cc config variable
2009-01-11 23:27:29 -08:00
Junio C Hamano 687004b512 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
2009-01-11 23:24:42 -08:00
jidanni@jidanni.org 4fc988efe6 Documentation/git-push.txt: minor: compress one option
Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-11 21:47:26 -08:00
Junio C Hamano 152d70f728 Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  README: tutorial.txt is now called gittutorial.txt
2009-01-06 22:12:35 -08:00
Junio C Hamano 141201d124 Merge branch 'maint-1.5.6' into maint-1.6.0
* maint-1.5.6:
  README: tutorial.txt is now called gittutorial.txt
2009-01-06 22:12:30 -08:00
Joey Hess 8a124b82a0 README: tutorial.txt is now called gittutorial.txt
Signed-off-by: Joey Hess <joey@gnu.kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-06 22:12:07 -08:00
Henrik Austad 0ddd93b271 Be consistent in switch usage for tar
tar handles switches with and witout preceding '-', but the
documentation should be consistent nonetheless.

Signed-off-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 12:04:23 -08:00
Henrik Austad c7719fbe46 Use capitalized names where appropriate
The Linux kernel and Emacs are both spelled capitalized

Signed-off-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 12:04:02 -08:00
Miklos Vajna dcfdbdf08b fast-export: print usage when no options specified
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-03 14:24:15 -08:00
Junio C Hamano 3442ea4a75 git checkout: do not allow switching to a tree-ish that is not a commit
"git checkout -b newbranch $commit^{tree}" mistakenly created a new branch
rooted at the current HEAD, because in that case, the two structure fields
used to see if the command was invoked without any argument (hence it
needs to default to checking out the HEAD) were populated incorrectly.

Upon seeing a command line argument that we took as a rev, we should store
that string in new.name, even if that does not name a commit.  This will
correctly trigger the existing safety logic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
2009-01-03 13:34:19 -08:00
Junio C Hamano 1f7903a371 builtin-apply: prevent non-explicit permission changes
A git patch that does not change the executable bit records the mode bits
on its "index" line.  "git apply" used to interpret this mode exactly the
same way as it interprets the mode recorded on "new mode" line, as the
wish by the patch submitter to set the mode to the one recorded on the
line.

The reason the mode does not agree between the submitter and the receiver
in the first place is because there is _another_ commit that only appears
on one side but not the other since their histories diverged, and that
commit changes the mode.  The patch has "index" line but not "new mode"
line because its change is about updating the contents without affecting
the mode.  The application of such a patch is an explicit wish by the
submitter to only cherry-pick the commit that updates the contents without
cherry-picking the commit that modifies the mode.  Viewed this way, the
current behaviour is problematic, even though the command does warn when
the mode of the path being patched does not match this mode, and a careful
user could detect this inconsistencies between the patch submitter and the
patch receiver.

This changes the semantics of the mode recorded on the "index" line;
instead of interpreting it as the submitter's wish to set the mode to the
recorded value, it merely informs what the mode submitter happened to
have, and the presense of the "index" line is taken as submitter's wish to
keep whatever the mode is on the receiving end.

This is based on the patch originally done by Alexander Potashev with a
minor fix; the tests are mine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-02 13:24:12 -08:00
jidanni@jidanni.org d99bf51add Documentation/git-tag.txt: minor typo and grammar fix
Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-01 05:33:35 -08:00
Junio C Hamano 936b7057e8 Prepare for v1.6.1.1 maintenance release
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-29 01:17:34 -08:00
jidanni@jidanni.org a9e67c8ccc Documentation/diff-options.txt: unify options
Instead of listing short option (e.g. "-U<n>") as a shorthand for its
longer counterpart (e.g. "--unified=<n>"), list the synonyms together.  It
saves one indirection to find what the reader wants.

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-29 01:08:02 -08:00
Markus Heidelberg bd7c6e7fc5 doc/git-send-email: mention sendemail.cc config variable
This variable was added in 5f8b9fc (git-send-email: add a new
sendemail.cc configuration variable, 2008-04-27), but is not yet refered
to by the documentation.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-29 01:06:11 -08:00
Devin Doucette fb3bb3d132 gitweb: Fix export check in git_get_projects_list
When $filter was empty, the path passed to check_export_ok would
contain an extra '/', which some implementations of export_auth_hook
are sensitive to.

It makes more sense to fix this here than to handle the special case
in each implementation of export_auth_hook.

Signed-off-by: Devin Doucette <devin@doucette.cc>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27 22:34:03 -08:00
Junio C Hamano a9012e343e Merge branch 'rs/maint-tformat-foldline' into maint
* rs/maint-tformat-foldline:
  pretty: support multiline subjects with format:
  pretty: factor out format_subject()
  pretty: factor out skip_empty_lines()
2008-12-27 14:22:37 -08:00
Junio C Hamano f611c8c0d1 Merge branch 'rs/maint-retval-fix' into maint
* rs/maint-retval-fix:
  merge-file: handle freopen() failure
  daemon: cleanup: factor out xstrdup_tolower()
  daemon: cleanup: replace loop with if
  daemon: handle freopen() failure
2008-12-27 14:21:24 -08:00
Junio C Hamano fcd3549ef2 Merge branch 'sp/maint-describe-all-tag-warning' into maint
* sp/maint-describe-all-tag-warning:
  describe: Avoid unnecessary warning when using --all
2008-12-27 14:21:15 -08:00
Adeodato Simó f83b9ba209 git-send-email.txt: move --format-patch paragraph to a proper location
When introducing --format-patch, its documentation was accidentally inserted
in the middle of documentation for --validate.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27 13:54:00 -08:00
Adeodato Simó 3a882d9696 git-shortlog.txt: improve documentation about .mailmap files
The description on .mailmap made it seem like they are only useful for
commits with a wrong address for an author, but they are about fixing the
real name.  Explain this better in the text, and replace the existing
example with a new one that hopefully makes things clearer.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27 13:52:19 -08:00
René Scharfe f53bd743ff pretty: support multiline subjects with format:
git log --pretty=format:%s (and tformat:) used to display the first
line of the subject, unlike the other --pretty options, which would
construct a subject line from all lines of the first paragraph of
the commit message.

For consistency and increased code reuse, change format: to do the
same as the other options.

Before:
	$ git log --pretty=oneline v1.6.1 | md5sum
	7c0896d2a94fc3315a0372b9b3373a8f  -
	$ git log --pretty=tformat:"%H %s" v1.6.1 | md5sum
	298903b1c065002e15daa5329213c51f  -

After:
	$ git log --pretty=tformat:"%H %s" v1.6.1 | md5sum
	7c0896d2a94fc3315a0372b9b3373a8f  -
	$ git log --pretty=oneline v1.6.1 | md5sum
	7c0896d2a94fc3315a0372b9b3373a8f  -

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27 12:02:49 -08:00
René Scharfe 88c44735ab pretty: factor out format_subject()
The next patch will use it.

In the version that was factored out, we can't rely on the len of the
struct strbuf to find out if a line separator needs to be added, as
it might already contain something.  Add a guard variable ("first")
instead.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27 12:02:40 -08:00
René Scharfe a010966844 pretty: factor out skip_empty_lines()
The patch after the next one will use it.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-27 12:02:32 -08:00
René Scharfe 4deba8b779 merge-file: handle freopen() failure
Report the error if redirection of stderr to /dev/null failed.

This silences a compiler warning about ignoring the return value
of freopen() on Ubuntu 8.10.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-26 19:10:02 -08:00
René Scharfe 6720e95b30 daemon: cleanup: factor out xstrdup_tolower()
Add xstrdup_tolower(), a helper to get a lower case copy of a
string, and use it in two cases.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-26 19:09:56 -08:00
René Scharfe a583971f15 daemon: cleanup: replace loop with if
Replace a loop around an enter_repo() call, which was used to retry
a single time with a different parameter in case the first call fails,
with two calls and an if.  This is shorter and cleaner.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-26 19:08:32 -08:00
René Scharfe c569b1fee1 daemon: handle freopen() failure
Die if stderr couldn't be sent to /dev/null when operating in inetd
mode and report the error message from the OS.

This fixes a compiler warning about the return value of freopen()
being ignored on Ubuntu 8.10.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-26 19:07:56 -08:00
Shawn O. Pearce 81dc223deb describe: Avoid unnecessary warning when using --all
In 212945d4 ("Teach git-describe to verify annotated tag names
before output") git-describe learned how to output a warning if
an annotated tag object was matched but its internal name doesn't
match the local ref name.

However, "git describe --all" causes the local ref name to be
prefixed with "tags/", so we need to skip over this prefix before
comparing the local ref name with the name recorded inside of the
tag object.

Patch-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-26 16:37:53 -08:00