<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_definitions}
\input{common_latex/common_latex_help_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Help Topic: The SVN Commit Command}
\vspace{0.1in}
\labdate{Spring 2021}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labline
\end{labcover}

\wikidoc{file=Help.SVNCommit}
\wikidoc{auth=mikerb@mit.edu}

%====================================================================
\section*{The SVN \cmd{commit} Command}
%====================================================================

The \cmd{svn commit} command sends changes from your working copy to
the respository. A log message (even if empty) must be provided. The
message can be given on the command line, from a file, or an editor
may be launched as the commit proceeds.  More info on \cmd{svn commit} can
always be found by Googling "Subversion book" and reading the full PDF
online free, or just typing \cmd{svn help commit} anytime on the command
line.

%---------------------------------------------------------------------
\subsection*{Basic usage of the svn \cmd{commit} command}

The shortest basic syntax for the svn \cmd{commit} command below.
The shorthand version for \cmd{svn commit} is \cmd{svn ci}.

\vspace{0.1in}
\begin{consoleverb}
 $ svn -m "" ci
\end{consoleverb}
\vspace{0.15in}

\noindent
The \cmd{svn commit} command {\em does} require a network connection
to the server, and you will be prompted for a password (unless you have
something liki ssh keys in use).

\pskip

The \cmd{-m ""} option is essentially allowing the commit to proceed
without any textual log file comment. This is generally not a good
idea, especially the bigger and more complex the commit. But I often
find this is reasonable especially if it's just me working on a
development branch. I'll save the complex comment for the commit that
merges the branch back into the trunk.  The \cmd{-m ""} option could
instead have been \cmd{--message "Fixing the butterfly bug"}.

%---------------------------------------------------------------------
\subsection*{Committing just a single file or directory}

In the above example, by leaving any file or directory unspecified, the 
commit is applied to every outstanding pending change. The pending
changes are viewable with the \cmd{svn status} command. You could have
instead proceeded by:

\vspace{0.1in}
\begin{consoleverb}
 $ svn commit -m "fixed the hanging input bug" KeyboardItems.cpp
 $ svn commit -m "undid Paul's broken fix" Blackboard.cpp
 $ svn commit -m "updated with italian additions" UtilitiesFolder/
\end{consoleverb}
\vspace{0.15in}

\noindent
After each commit, the file(s) committed are removed from the list of
pending changes. So you can still finish things off with a \cmd{svn -m
"" ci} after you've applied all the comments worth logging.

%------------------------------------------------------------------
\subsection*{Configuring SVN with an editor of your choosing}

Getting back to that issue of launching an editor to enter commit
comments as described above. "Which editor?" you may ask. The editor
chosen is determined by how you have certain environment variables set
in your shell configuration. It will first look for the value of
the \var{SVN\_EDITOR} variable, and fall back to the value for
the \var{EDITOR} environment variable. If these are not set, svn may
not allow you to select the (e) option.

\pskip
\noindent
If you're a \var{tcsh} user, add the following lines to
your \var{.cshrc} file, with the editor of your choosing:

\vspace{0.1in}
\begin{fileverb}
  setenv EDITOR 'emacs'
  setenv SVN_EDITOR 'emacs'
\end{fileverb}
\vspace{0.15in}

\noindent
If you're a \var{bash} user, add the following lines to
your \var{.bashrc} file, with the editor of your choosing:

\vspace{0.1in}
\begin{fileverb}
  export EDITOR=emacs
  export SVN_EDITOR=emacs
\end{fileverb}
\vspace{0.15in}

\noindent
To check the prevailing value of an environment variable, e.g., \var{EDITOR}, 
just type this on the command line: \cmd{echo \$EDITOR}.

\end{document}

</pre></body></html>