Commit Graph

85 Commits

Author SHA1 Message Date
fa66d6c927 Merge pull request 'Revert to exit 1' () from develop into main
Reviewed-on: 
2025-03-03 22:52:02 +00:00
5c48df99b4 Revert to exit 1 2025-03-03 22:51:34 +00:00
b99b7018fb Merge pull request 'Change pre_push exit status to 0' () from develop into main
Reviewed-on: 
2025-03-03 22:46:46 +00:00
86c514fac4 Change exit status 2025-03-03 22:44:47 +00:00
23daab16f3 Add git status to install 2025-03-03 21:51:14 +00:00
413ae233e4 Merge pull request 'Revert to v1_candidate' () from develop into main
Reviewed-on: 
2025-02-28 19:45:14 +00:00
Daniel Lindmark
11c31ceed1 Revert to v1_candidate tag 2025-02-28 13:44:43 -06:00
2996fdf602 Improve svn clone 2025-02-28 18:05:49 +00:00
Daniel Lindmark
a00b2b3441 Fix alias syntax 2025-02-28 11:21:43 -06:00
Daniel Lindmark
35bea6f8f8 Add git-push-custom.sh 2025-02-28 11:15:01 -06:00
18c0568032 Add alias to local git push, runs git-push-custom.sh 2025-02-28 17:03:06 +00:00
ad04c76a4b Add custom hook 2025-02-28 16:53:17 +00:00
6f6f3e34d4 Update .allspice/fetch-svn.bat 2025-02-27 22:32:30 +00:00
49a5025dbd Fix hook 2025-02-27 22:31:17 +00:00
5d0285eaca Update color formatting, remove whitespace 2025-02-26 08:24:19 +00:00
00ed262efc Change color formatting 2025-02-26 08:16:37 +00:00
2ae5458d1f Fix syntax 2025-02-26 08:08:44 +00:00
35ba8a04bf Add color coding to log function 2025-02-26 08:07:21 +00:00
96f7859f23 Add change from cmd to bash 2025-02-26 07:49:40 +00:00
b05e63629a Add pass by file latest-repo.txt for pwd 2025-02-26 07:47:55 +00:00
99edbd4bf6 Fix REPO_NAME output 2025-02-26 07:44:46 +00:00
21577cc9b7 Remove pause 2025-02-26 07:39:44 +00:00
226174a1d7 Add repo path > latest-repo.txt 2025-02-26 07:38:30 +00:00
4eaff6417a Refactor logging 2025-02-26 07:15:42 +00:00
f9e2130a92 Add log_header() 2025-02-26 06:48:59 +00:00
8444a2a9b9 Add calls to validate_url 2025-02-26 06:34:36 +00:00
9b3ea5a9ef Add whitespace 2025-02-26 06:25:26 +00:00
ed22a94fb0 Update .allspice/svn-to-allspice.sh 2025-02-26 06:20:39 +00:00
6a3a6a8096 Fix copy/paste error 2025-02-26 06:12:54 +00:00
00b43cc8de Add URL input validation 2025-02-26 06:09:30 +00:00
b0d7896bc1 Fix color formatting syntax 2025-02-26 06:02:20 +00:00
7606431a73 Add logging 2025-02-26 06:00:09 +00:00
db096431d7 Delete .gitignore 2025-02-26 05:13:33 +00:00
4105b17e1d Delete b7.txt 2025-02-26 05:13:17 +00:00
899c56ef92 Update clone-allspice-and-svn-monorepo.bat 2025-02-25 23:07:43 +00:00
45f329d62e Update .allspice/svn-to-allspice.sh 2025-02-25 23:05:01 +00:00
fc3b23e703 Add [xx] numbering and other qol whitespace 2025-02-25 23:00:59 +00:00
20449e2dd5 Fix git push --set-upstream origin git-svn 2025-02-25 16:31:11 -06:00
4096ccfa23 Remove develop branch in favor of git-svn 2025-02-25 16:31:11 -06:00
0dfe350c43 Change working branch to git-svn 2025-02-25 16:31:11 -06:00
d1cccab98e Update rebase sequence 2025-02-25 16:31:11 -06:00
105d62d761 Added git config --local core.hooksPath .git/hooks 2025-02-25 16:31:11 -06:00
e289cf16b3 Remove core.hooksPath setting 2025-02-25 16:31:11 -06:00
2836a971c5 Change core.hooksPath 2025-02-25 16:31:11 -06:00
14621c504b s/AllSpice-Loves-SVN/AllSpice-Loves-SVN-Monorepos 2025-02-25 16:31:11 -06:00
1dd3bc9f18 Remove git rebase git-svn 2025-02-25 16:31:11 -06:00
a98260c264 Add v number 2025-02-25 16:31:10 -06:00
d75ff856c6 Add git rebase main 2025-02-25 16:31:10 -06:00
0c2131e78a Made robuster
Potential Causes of the Conflict:

From the script, I see several points where conflicts might arise:
	1.	Directly Forcing the git-svn Branch onto develop and main

git checkout develop
git reset --hard git-svn
git checkout main
git reset --hard develop
git push --force origin main
git push --force origin develop

	•	Issue: The script forcefully resets develop and main to git-svn, which can overwrite existing commits, leading to potential conflicts when users pull changes later.
	•	Fix: Consider using git rebase instead of git reset --hard. Also, avoid git push --force unless absolutely necessary.

	2.	Mixing git svn clone and git pull --all

git svn clone -r HEAD "$SVN_URL" "$USERPROFILE/allspice/$REPO_NAME" &> "$LOGFILE"
git fetch --all
git pull --all

	•	Issue: git svn clone creates a local Git repository with SVN history, but immediately after, the script fetches and pulls all remote branches. This can introduce merge conflicts if git pull brings in changes that weren’t present in SVN.
	•	Fix: Instead of git pull --all, try git fetch --all followed by git rebase git-svn to ensure changes are applied cleanly.

	3.	Automated .gitignore Changes and Commits

if git diff --quiet -- .gitignore; then
  git add .gitignore
  git commit -m "Update .gitignore"
  git push
fi

	•	Issue: If multiple users are running this script, .gitignore might change differently on different machines, leading to conflicts.
	•	Fix: Instead of committing the .gitignore changes automatically, consider prompting the user to review before committing.

Recommendations:
	1.	Change Forced Resets to Rebase

git checkout develop
git rebase git-svn
git checkout main
git rebase develop
git push origin main
git push origin develop

	•	This keeps the history intact while incorporating git-svn updates.

	2.	Replace git pull --all with a Safer Update

git fetch --all
git rebase git-svn

	•	Ensures that local changes are applied cleanly on top of git-svn.

	3.	Prompt User Before Committing .gitignore Changes

if ! git diff --quiet -- .gitignore; then
  echo "Review .gitignore changes before committing:"
  git diff .gitignore
  read -p "Commit these changes? (y/n) " confirm && [[ $confirm == [yY] ]] && git add .gitignore && git commit -m "Update .gitignore" && git push
fi

	•	This gives control to the user instead of blindly pushing changes.
2025-02-25 16:31:10 -06:00
894e5e1c85 Add whitespace 2025-02-25 16:31:10 -06:00