On AIX, there is no -n option to the system's echo. Instead,
it needs the '\c' control character. We could replace
echo -n "foo"
with
echo -e "foo\c"
but printf is recommended by most man pages. Tested on AIX
5.3, Solaris 8, and Debian.
[jc: futureproofed two instances that uses variable with '%s'
so later feeding different messages would not break things too
easily; others are emitting literal so whoever changes the
literal ought to notice more easily so they are safe.]
Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This matches the 3-way fallback used by applypatch to use
per-blob "index" lines, not "applies-to" tree object name, to
match what git-am does.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Now all the users of this script detect its exit status and die,
complaining that it is outside git repository. So move the code
that dies from all callers to git-sh-setup script.
Signed-off-by: Junio C Hamano <junkio@cox.net>
After git-apply fails, attempt to find a base tree that the patch
cleanly applies to, and do a three-way merge using that base tree into
the current index, if .dotest/.3way file exists. This flag can be
controlled by giving -m flag to git-applymbox command.
When the fall-back merge fails, the working tree can be resolved the
same way as you would normally hand resolve a conflicting merge.
When making commit, use .dotest/final-commit as the log message
template. Or you could just choose to 'git-checkout-index -f -a'
to revert the failed merge.
Signed-off-by: Junio C Hamano <junkio@cox.net>
- Defined variable $INFO was not used properly.
- Make sure there is an empty line between the sign-off and the
log message.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This uses the git-update-ref command in scripts for safer updates.
Also places where we used to read HEAD ref by using "cat" were fixed
to use git-rev-parse. This will matter when we start using symbolic
references.
Signed-off-by: Junio C Hamano <junkio@cox.net>
As promised, this is the "big tool rename" patch. The primary differences
since 0.99.6 are:
(1) git-*-script are no more. The commands installed do not
have any such suffix so users do not have to remember if
something is implemented as a shell script or not.
(2) Many command names with 'cache' in them are renamed with
'index' if that is what they mean.
There are backward compatibility symblic links so that you and
Porcelains can keep using the old names, but the backward
compatibility support is expected to be removed in the near
future.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Also make platform specific part more isolated. Currently we only
have Darwin defined, but I've taken a look at SunOS specific patch
(which I dropped on the floor for now) as well. Doing things this way
would make adding it easier.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This teachs git-applypatch, which is used from git-applymbox, three
hooks, similar to what git-commit-script uses.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This corresponds to the -k flag to git format-patch --mbox
option. The option should probably not be used when applying a
real e-mail patch, but is needed when format-patch and applymbox
pair is used for cherrypicking.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Hey, people are using them, and we have an install target for them, so
make sure that we can actually install them sanely without disturbing
the namespace.
Rename into a "tools" subdirectory, and change name of "dotest" to "applymbox".
Remove stripspace (which was already copied into git) and cvs2git (which
was likewise already copied into git, and then replaced by a much better
perl version).
All of this was brought on by Ryan Anderson shaming me into it. Thanks.
I guess.
..and git-apply does a lot better job at it anyway.
Also, we break the comment/diff on a line that starts with "diff -", not
just on the "---" line. Especially for git diffs, we actually want that
line in the diff.
(We should probably also break on "Index: ..." followed by "=====")
Now that git does pretty reliable date parsing, we might as well get
the date from the email itself. Of course, it's still questionable
whether the date on the email is all that relevant, but it's certainly
no worse than taking the commit date.
This makes "dotest" a lot nicer to sue, especially for people who were
used to editing the commit comments after-the-fact in BK, which git
doesn't apply.
he syntax is
dotest [-q] mailbox [signoff]
so the command line operates exactly as you're used to. If you supply
the -q it will query before applying (I also added the [a]pply all the
rest option). If the signoff file is absent, no signoff line gets
added.
There's also one addition in this: a checkout-cache line. I added that
for poor saps like me whose laptop takes minutes to checkout a full
build tree, so I can run dotest in a directory with no checked out
files.
My brain just flipped when it tried to read the "Applying" as part
of the explanation of the patch, and the sentence didn't make any
sense. The quotes make it clear what's going on.